mirror of
https://github.com/elyby/accounts.git
synced 2024-11-30 10:42:16 +05:30
Не логгируем InvalidSubjectException, возникающий из-за перехода на новый формат токенов
This commit is contained in:
parent
58d3fd57a8
commit
c7cf54f32f
@ -4,6 +4,7 @@ namespace api\components\User;
|
||||
use common\models\Account;
|
||||
use Emarref\Jwt\Claim\Subject;
|
||||
use Emarref\Jwt\Exception\ExpiredException;
|
||||
use Emarref\Jwt\Exception\InvalidSubjectException;
|
||||
use Emarref\Jwt\Token;
|
||||
use Exception;
|
||||
use Yii;
|
||||
@ -28,7 +29,8 @@ class JwtIdentity implements IdentityInterface {
|
||||
$component = Yii::$app->user;
|
||||
try {
|
||||
$token = $component->parseToken($rawToken);
|
||||
} catch (ExpiredException $e) {
|
||||
} catch (ExpiredException | InvalidSubjectException $e) {
|
||||
// InvalidSubjectException is temporary solution and should be removed in the next release
|
||||
throw new UnauthorizedHttpException('Token expired');
|
||||
} catch (Exception $e) {
|
||||
Yii::error($e);
|
||||
|
Loading…
Reference in New Issue
Block a user