def verify_token(self, token):
try:
decode = jwt.decode(token, self.token_config.get('secret'), algorithm=self.token_config.get('algorithm'))
except jwt.ExpiredSignatureError:
raise AuthException('Time is up', 401, AuthException.TOKEN_TIME_UP)
except:
raise AuthException('Token is not valid', 401, AuthException.TOKEN_ERROR)
return decode
评论列表
文章目录