verify audience in jwt
This commit is contained in:
parent
ae6dfb2644
commit
424273360d
|
@ -193,7 +193,6 @@ def gen_token(auth):
|
|||
'iss': issuer,
|
||||
'aud': audience
|
||||
}
|
||||
|
||||
token = jwt.encode(payload, secret, algorithm='HS256')
|
||||
return token
|
||||
|
||||
|
@ -210,8 +209,7 @@ def access_token(request):
|
|||
token = jwt.encode(decoded, secret, algorithm='HS256')
|
||||
return Response(text=str(token.decode('utf-8')))
|
||||
else:
|
||||
return HTTPUnauthorized(reason='Token could not be refreshed')
|
||||
return True
|
||||
return HTTPUnauthorized(reason='Token could not be verified')
|
||||
|
||||
def verify_token(token):
|
||||
secret = get_config()['jwt']['secret']
|
||||
|
|
Loading…
Reference in New Issue