chore: apply ty checks on api code with script and ci action (#24653)
This commit is contained in:
parent
c373b734bc
commit
7b379e2a61
48 changed files with 188 additions and 142 deletions
|
|
@ -14,11 +14,11 @@ class PassportService:
|
|||
def verify(self, token):
|
||||
try:
|
||||
return jwt.decode(token, self.sk, algorithms=["HS256"])
|
||||
except jwt.exceptions.ExpiredSignatureError:
|
||||
except jwt.ExpiredSignatureError:
|
||||
raise Unauthorized("Token has expired.")
|
||||
except jwt.exceptions.InvalidSignatureError:
|
||||
except jwt.InvalidSignatureError:
|
||||
raise Unauthorized("Invalid token signature.")
|
||||
except jwt.exceptions.DecodeError:
|
||||
except jwt.DecodeError:
|
||||
raise Unauthorized("Invalid token.")
|
||||
except jwt.exceptions.PyJWTError: # Catch-all for other JWT errors
|
||||
except jwt.PyJWTError: # Catch-all for other JWT errors
|
||||
raise Unauthorized("Invalid token.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue