thefx/yii2-user

User

Installs: 116

Dependents: 2

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

dev-master 2023-02-08 16:32 UTC

This package is auto-updated.

Last update: 2024-05-08 19:15:42 UTC


README

Either run

composer require thefx/yii2-user:dev-master

or add

"thefx/yii2-blocks": "dev-master"

Apply Migrations

php yii migrate --migrationPath=@thefx/user/migrations

Config

'modules' => [
    'user' => [
        'class' => 'thefx\user\Module',
    ],
],
'components' => [
    'user' => [
        'identityClass' => 'thefx\user\models\User',
        'enableAutoLogin' => true,
        'loginUrl' => ['/login'],
    ],
],
'urlManager' => [
    'rules' => [
        '<_a:(login|logout|register|email-confirm|password-reset-request|password-reset|email-confirm-request)>' => 'frontend/user/<_a>',
    ]
]

If you want to prevent registration

'user' => [
    'class' => 'thefx\user\Module',
    'controllerMap' => [
        'default' => [
            'class' => 'thefx\user\controllers\DefaultController',
            'allowRegister' => false,
        ],
    ],
],

Links

https://mysite.ru/login
https://mysite.ru/register