beardedandnotmuch / yii2-jwt-user
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 2
Type:yii2-extension
Requires
- lcobucci/jwt: ~3.2
- league/uri-manipulations: ^1.0
- league/uri-schemes: ^1.0
- spomky-labs/base64url: ^1.0
- yiisoft/yii2: ~2.0.13
This package is not auto-updated.
Last update: 2025-09-12 12:25:30 UTC
README
Yii2 module which allows to authenticate users by using JWT tokens
Under development.
No tests yet.
Example of config
... 'modules' => [ 'auth' => [ 'class' => 'beardedandnotmuch\user\Module', 'viewPath' => '@frontend/views', 'forceLogin' => true, 'duration' => function () { return is_mobile() ? false : 24 * 60 * 60; }, 'modelMap' => [ 'User' => 'frontend\models\User', 'LoginForm' => 'frontend\models\LoginForm', 'ReplacePasswordForm' => 'frontend\models\ReplacePasswordForm', 'ResetPasswordForm' => 'frontend\models\ResetPasswordForm', 'RegistrationForm' => [ 'class' => 'frontend\models\RegistrationForm', 'key' => $params['registration.salt'], ], ], 'on beforeLogin' => ['frontend\helpers\EventsHelper', 'beforeLogin'], 'on afterLogin' => ['frontend\helpers\EventsHelper', 'afterLogin'], 'on afterLogout' => ['frontend\helpers\EventsHelper', 'afterLogout'], 'on afterRegistration' => ['frontend\helpers\EventsHelper', 'afterRegistration'], 'on sendResetPassword' => ['frontend\helpers\EventsHelper', 'sendResetPassword'], ], ], ...
Default routes
GET|PUT /api/user
POST|DELETE /api/user/session
POST /api/user/auth
PUT /api/user/password
POST|PUT /api/user/password/reset
POST confirm
POST heartbeat