def prepare(self):
"""
Ensures that the caller is a validated user
"""
super().prepare()
try:
if self.current_user is None:
self.send_error(401) # TODO Add details
except jwt.InvalidIssuedAtError:
log.error("The IAT-claim of the passed token is less than the last time the user password changed")
self.send_error(401, summary="invalidated token")
except jwt.ExpiredSignatureError:
log.error("The EXT-claim of the passed token is less than the current UNIX time")
self.send_error(401, summary="expired token")
except jwt.InvalidTokenError:
log.error("The passed token could not be validated")
self.send_error(401, summary="invalid token")
authenticated_endpoint.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录