{"id":22711222,"url":"https://github.com/yiicod/yii2-auth","last_synced_at":"2025-08-09T14:09:26.558Z","repository":{"id":27000886,"uuid":"30464891","full_name":"yiicod/yii2-auth","owner":"yiicod","description":null,"archived":false,"fork":false,"pushed_at":"2018-02-18T17:21:56.000Z","size":52,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T15:12:45.463Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yiicod.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-07T18:12:29.000Z","updated_at":"2025-01-29T19:31:40.000Z","dependencies_parsed_at":"2022-08-31T14:00:24.224Z","dependency_job_id":null,"html_url":"https://github.com/yiicod/yii2-auth","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiicod%2Fyii2-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiicod%2Fyii2-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiicod%2Fyii2-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiicod%2Fyii2-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yiicod","download_url":"https://codeload.github.com/yiicod/yii2-auth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248732487,"owners_count":21152852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-10T12:14:59.507Z","updated_at":"2025-04-13T15:12:49.223Z","avatar_url":"https://github.com/yiicod.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Auth extensions\n===============\n\nIf you want simple auth (login/signup/forgot), this is what you want! This extension\nhas simple action what have added in controller. Extension has events: \n\n[![Latest Stable Version](https://poser.pugx.org/yiicod/yii2-auth/v/stable)](https://packagist.org/packages/yiicod/yii2-auth) [![Total Downloads](https://poser.pugx.org/yiicod/yii2-auth/downloads)](https://packagist.org/packages/yiicod/yii2-auth) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/yiicod/yii2-auth/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/yiicod/yii2-auth/?branch=master)[![Code Climate](https://codeclimate.com/github/yiicod/yii2-auth/badges/gpa.svg)](https://codeclimate.com/github/yiicod/yii2-auth)\n\nInstallation\n------------\nThe preferred way to install this extension is through [composer](http://getcomposer.org/download/).\n\nEither run\n\n```\nphp composer.phar require --prefer-dist yiicod/yii2-auth \"*\"\n```\n\nor add\n\n```json\n\"yiicod/yii2-auth\": \"*\"\n```\n\nto the require section of your composer.json.\n\nrun\n```php\nphp yii migrate/up --migrationPath=@yiicod/auth/migrations\n```\nPlease 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.\n```php\n'i18n' =\u003e [\n    'translations' =\u003e [\n        '*' =\u003e [\n            'class' =\u003e 'yii\\i18n\\PhpMessageSource'\n        ],\n    ],\n],\n```\nConfig\n------\n\n```php\n'components' =\u003e [\n    'auth' =\u003e [\n        'class' =\u003e 'yiicod\\auth\\Auth',\n    ],\n]\n\n'bootstrap' =\u003e ['auth']\n```\n\nUsing\n-----\n\nCopy yiicod\\auth\\controllers\\WebUserController to controllers folder.\nAfter this you can use actions\n```php\n    /**\n     * Declares class-based actions.\n     * For change functional use AuthUserBehavior.\n     * Auth events:\n     *\n     * - beforeLogin(ActionEvent)\n     * - afterLogin(ActionEvent)\n     * - errorLogin(ActionEvent)\n     *\n     * - beforeSignup(ActionEvent)\n     * - afterSignup(ActionEvent)\n     * - errorSignup(ActionEvent)\n     *\n     * - beforeCheckRecoveryKey(ActionEvent)\n     * - afterCheckRecoveryKey(ActionEvent)\n     * - errorCheckRecoveryKey(ActionEvent)\n     *\n     * - beforeForgot(ActionEvent)\n     * - afterForgot(ActionEvent)\n     * - errorForgot(ActionEvent)\n     *\n     * - beforeLogout(ActionEvent)\n     * - afterLogout(ActionEvent)\n     *\n     *\n     * Global events\n     * yiicod.auth.controllers.webUser.[Action class name].[Event name (beforeLogin)]\n     * \n     *\n     */\n    public function actions()\n    {\n\n        return ArrayHelper::merge(parent::actions(), [\n                'login' =\u003e [\n                    'class' =\u003e \\yiicod\\auth\\actions\\webUser\\LoginAction::className(),\n                ],\n                'requestPasswordReset' =\u003e [\n                    'class' =\u003e \\yiicod\\auth\\actions\\webUser\\RequestPasswordResetAction::className(),\n                ],\n                'logout' =\u003e [\n                    'class' =\u003e \\yiicod\\auth\\actions\\webUser\\LogoutAction::className(),\n                ],\n                'signup' =\u003e [\n                    'class' =\u003e \\yiicod\\auth\\actions\\webUser\\SignupAction::className(),\n                ],\n                'resetPassword' =\u003e [\n                    'class' =\u003e \\yiicod\\auth\\actions\\webUser\\ResetPasswordAction::className(),\n                ],\n            ]\n        );\n    }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiicod%2Fyii2-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyiicod%2Fyii2-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiicod%2Fyii2-auth/lists"}