auth.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:barmanapi 作者: emin100 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号