2017 © Pedro Peláez
 

yii-extension yii2-auth

The simple auth(login,signup,forgot) with powerful extension for the Yii2 framework

image

yiicod/yii2-auth

The simple auth(login,signup,forgot) with powerful extension for the Yii2 framework

  • Sunday, February 18, 2018
  • by lexxorlov
  • Repository
  • 2 Watchers
  • 7 Stars
  • 110 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Auth extensions

If you want simple auth (login/signup/forgot), this is what you want! This extension has simple action what have added in controller. Extension has events:, (*1)

Latest Stable Version Total Downloads Scrutinizer Code QualityCode Climate, (*2)

Installation

The preferred way to install this extension is through composer., (*3)

Either run, (*4)

php composer.phar require --prefer-dist yiicod/yii2-auth "*"

or add, (*5)

"yiicod/yii2-auth": "*"

to the require section of your composer.json., (*6)

run, (*7)

php yii migrate/up --migrationPath=@yiicod/auth/migrations

Please note that messages are wrapped with Yii::t() to support message translations, you should define default message source for them if you don't use i18n., (*8)

'i18n' => [
    'translations' => [
        '*' => [
            'class' => 'yii\i18n\PhpMessageSource'
        ],
    ],
],

Config

'components' => [
    'auth' => [
        'class' => 'yiicod\auth\Auth',
    ],
]

'bootstrap' => ['auth']

Using

Copy yiicod\auth\controllers\WebUserController to controllers folder. After this you can use actions, (*9)

    /**
     * Declares class-based actions.
     * For change functional use AuthUserBehavior.
     * Auth events:
     *
     * - beforeLogin(ActionEvent)
     * - afterLogin(ActionEvent)
     * - errorLogin(ActionEvent)
     *
     * - beforeSignup(ActionEvent)
     * - afterSignup(ActionEvent)
     * - errorSignup(ActionEvent)
     *
     * - beforeCheckRecoveryKey(ActionEvent)
     * - afterCheckRecoveryKey(ActionEvent)
     * - errorCheckRecoveryKey(ActionEvent)
     *
     * - beforeForgot(ActionEvent)
     * - afterForgot(ActionEvent)
     * - errorForgot(ActionEvent)
     *
     * - beforeLogout(ActionEvent)
     * - afterLogout(ActionEvent)
     *
     *
     * Global events
     * yiicod.auth.controllers.webUser.[Action class name].[Event name (beforeLogin)]
     * 
     *
     */
    public function actions()
    {

        return ArrayHelper::merge(parent::actions(), [
                'login' => [
                    'class' => \yiicod\auth\actions\webUser\LoginAction::className(),
                ],
                'requestPasswordReset' => [
                    'class' => \yiicod\auth\actions\webUser\RequestPasswordResetAction::className(),
                ],
                'logout' => [
                    'class' => \yiicod\auth\actions\webUser\LogoutAction::className(),
                ],
                'signup' => [
                    'class' => \yiicod\auth\actions\webUser\SignupAction::className(),
                ],
                'resetPassword' => [
                    'class' => \yiicod\auth\actions\webUser\ResetPasswordAction::className(),
                ],
            ]
        );
    }

The Versions

18/02 2018

dev-master

9999999-dev

The simple auth(login,signup,forgot) with powerful extension for the Yii2 framework

  Sources   Download

MIT New BSD License

The Requires

 

The Development Requires

01/11 2015

1.0.2

1.0.2.0

The simple auth(login,signup,forgot) with powerful extension for the Yii2 framework

  Sources   Download

New BSD License

The Requires

 

26/07 2015

1.0.1

1.0.1.0

  Sources   Download

New BSD License

The Requires

 

07/06 2015

1.0.0

1.0.0.0

  Sources   Download

New BSD License

The Requires