Class dektrium\user\controllers\SecurityController

Inheritancedektrium\user\controllers\SecurityController » yii\web\Controller
Uses Traitsdektrium\user\traits\AjaxValidationTrait, dektrium\user\traits\EventTrait

Controller that manages user authentication process.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() dektrium\user\controllers\SecurityController
actionLogin() Displays the login page. dektrium\user\controllers\SecurityController
actionLogout() Logs the user out and then redirects to the homepage. dektrium\user\controllers\SecurityController
actions() dektrium\user\controllers\SecurityController
authenticate() Tries to authenticate user via social network. If user has already used this network's account, he will be logged in. Otherwise, it will try to create new user account. dektrium\user\controllers\SecurityController
behaviors() dektrium\user\controllers\SecurityController
connect() Tries to connect social account to user. dektrium\user\controllers\SecurityController

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
EVENT_AFTER_AUTHENTICATE 'afterAuthenticate' Event is triggered after authenticating user via social network. Triggered with \dektrium\user\events\AuthEvent. dektrium\user\controllers\SecurityController
EVENT_AFTER_CONNECT 'afterConnect' Event is triggered before connecting social network account to user. Triggered with \dektrium\user\events\AuthEvent. dektrium\user\controllers\SecurityController
EVENT_AFTER_LOGIN 'afterLogin' Event is triggered after logging user in. Triggered with \dektrium\user\events\FormEvent. dektrium\user\controllers\SecurityController
EVENT_AFTER_LOGOUT 'afterLogout' Event is triggered after logging user out. Triggered with \dektrium\user\events\UserEvent. dektrium\user\controllers\SecurityController
EVENT_BEFORE_AUTHENTICATE 'beforeAuthenticate' Event is triggered before authenticating user via social network. Triggered with \dektrium\user\events\AuthEvent. dektrium\user\controllers\SecurityController
EVENT_BEFORE_CONNECT 'beforeConnect' Event is triggered before connecting social network account to user. Triggered with \dektrium\user\events\AuthEvent. dektrium\user\controllers\SecurityController
EVENT_BEFORE_LOGIN 'beforeLogin' Event is triggered before logging user in. Triggered with \dektrium\user\events\FormEvent. dektrium\user\controllers\SecurityController
EVENT_BEFORE_LOGOUT 'beforeLogout' Event is triggered before logging user out. Triggered with \dektrium\user\events\UserEvent. dektrium\user\controllers\SecurityController

Property Details

$finder protected property
protected dektrium\user\Finder $finder null

Method Details

__construct() public method

public void __construct ( $id, $module, dektrium\user\Finder $finder, $config = [] )
$id string
$module dektrium\user\Module
$finder dektrium\user\Finder
$config array
actionLogin() public method

Displays the login page.

public string|\yii\web\Response actionLogin ( )
actionLogout() public method

Logs the user out and then redirects to the homepage.

public \yii\web\Response actionLogout ( )
actions() public method

public void actions ( )
authenticate() public method

Tries to authenticate user via social network. If user has already used this network's account, he will be logged in. Otherwise, it will try to create new user account.

public void authenticate ( \yii\authclient\ClientInterface $client )
$client \yii\authclient\ClientInterface
behaviors() public method

public void behaviors ( )
connect() public method

Tries to connect social account to user.

public void connect ( \yii\authclient\ClientInterface $client )
$client \yii\authclient\ClientInterface