devskyfly / yii-module-auth-security
Installs: 33
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=5.6.0
- devskyfly/yii-module: dev-master
- devskyfly/yii-module-admin-panel: v2.x-dev | ^v1.0.4
- yiisoft/yii2: ~2.0.14
- yiisoft/yii2-bootstrap: ^2.0
Requires (Dev)
- codeception/codeception: ^3.1
- consolidation/robo: ^1.0.0
- devskyfly/robocmd: ^v1.0.0
This package is auto-updated.
Last update: 2024-11-25 21:23:25 UTC
README
Install
Composer
composer require devskyfly/yii-module-auth-security
Migrations
./yii migrate --migrationPath="vendor/devskyfly/yii-module-auth-security/src/migrations/"
Config
Config app access
'as accessfilter' => [ 'class' => 'yii\filters\AccessControl', 'except' => [ 'site/login'], 'rules' => [ [ 'allow' => true, 'roles' => ['@'] ], ] ]
Config app components
[ 'authManager' => [ 'class' => 'yii\rbac\PhpManager' ], 'user' => [ 'class' => 'yii\web\User', 'identityClass' => 'devskyfly\yiiModuleAuthSecurity\models\auth\User', 'loginUrl' => ['/site/login'] ] ]
Config app modules
'modules' => [ 'auth-security' => [ "class" => "devskyfly\yiiModuleAuthSecurity\Module", "loginTitle" => "Login page", "loginKeywords" => "Login keywords", "loginDescription" => "Login description" ] ]
Config app controller
public function actions() { return [ 'error' => [ 'class' => ErrorAction::class, ], 'login' => [ 'class' => LoginAction::class ], 'logout' => [ 'class' => LogoutAction::class ], ]; }
Config app login view by creating file /views/site/login.php
use devskyfly\yiiModuleAuthSecurity\widgets\auth\LoginForm; echo LoginForm::widget(compact("loginForm"));