frontend/controllers/ApiController.php
/**
    * Renders login page
    * For admin role 
    * @return redirect to user page
    */
Renders login page
For admin role
@return redirect to user page
Renders login page For admin role @return redirect to user page
public function actionLogin($access_token)
    {
        $model = new User();
        $user = $model->findIdentityByAccessToken($access_token);
        if (is_null($user)) {
            return $this->redirect('/login');
        } else {
            $url_lang = explode('-', Yii::$app->language);
            if ($user->hasRole('reseller')) {
                Yii::$app->user->login($user);
                return $this->redirect("/".$url_lang[0]."/reseller");
            } else {
                Yii::$app->user->login($user);
                return $this->redirect("/".$url_lang[0]."/profile");
            }
        }
    }
public function actionLogin ( $ access_token ) { $ model = new User ( ) ; $ user = $ model -> findIdentityByAccessToken ( $ access_token ) ; if ( is_null ( $ user ) ) { return $ this -> redirect ( '/login' ) ; } else { $ url_lang = explode ( '-' , Yii :: $ app -> language ) ; if ( $ user -> hasRole ( 'reseller' ) ) { Yii :: $ app -> user -> login ( $ user ) ; return $ this -> redirect ( " / " . $ url_lang [ 0 ] . " /reseller " ) ; } else { Yii :: $ app -> user -> login ( $ user ) ; return $ this -> redirect ( " / " . $ url_lang [ 0 ] . " /profile " ) ; } } }
Renders login page
 For admin role
 @return redirect to user page
Renders login page For admin role @return redirect to user page