From 5649c49a575d27c021d069129a39028f49ecd35f Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Mon, 1 Jan 2018 17:12:15 +0300 Subject: [PATCH] Fixes ACCOUNTS-319 --- api/components/User/Component.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/components/User/Component.php b/api/components/User/Component.php index 4049771..95b52fd 100644 --- a/api/components/User/Component.php +++ b/api/components/User/Component.php @@ -132,7 +132,11 @@ class Component extends YiiUserComponent { $token = &self::$parsedTokensCache[$jwtString]; if ($token === null) { $jwt = new Jwt(); - $notVerifiedToken = $jwt->deserialize($jwtString); + try { + $notVerifiedToken = $jwt->deserialize($jwtString); + } catch (Exception $e) { + throw new VerificationException('Incorrect token encoding', 0, $e); + } $context = new VerificationContext(EncryptionFactory::create($this->getAlgorithm())); $context->setSubject(self::JWT_SUBJECT_PREFIX);