def jwt_auth(auth_request): token = auth_request.token decoded = None try: decoded = auth.decode_jwt_token(token) except jwt.exceptions.InvalidSignatureError as e: return AuthResponse(routes=[''], principal_id=None) return AuthResponse(routes=['*'], principal_id=decoded['sub'])
def jwt_auth(auth_request): token = auth_request.token decoded = auth.decode_jwt_token(token) app.log.debug(decoded) if decoded is not None: return AuthResponse(routes=['*'], principal_id=(decoded['email'], decoded['name'])) else: return AuthResponse(routes=[], principal_id='')
def jwt_auth(auth_request): token = auth_request.token decoded = auth.decode_jwt_token(token) return AuthResponse(routes=['*'], principal_id=decoded['sub'])
def authorizer(auth_request): token = auth_request.token decoded = decode_jwt_token(token, JWT_SECRET) # Here login_info = email + "|" + role return AuthResponse(routes=['*'], principal_id=decoded['sub'])