Commit aa66a759 authored by echel0n's avatar echel0n

Added exception handling for JWTError's during JWT auth

parent 7ac10856
......@@ -21,7 +21,7 @@
import sentry_sdk
from jose import ExpiredSignatureError
from jose import ExpiredSignatureError, JWTError
import sickrage
from sickrage.core.enums import UserPermission
......@@ -60,6 +60,9 @@ class LoginHandler(BaseHandler):
except ExpiredSignatureError:
return self.write({'error': 'Token expired'})
except JWTError as e:
return self.write({'error': f'Improper JWT token supplied, {e!r}'})
if not = decoded_token.get('sub')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment