Fix handling of tokens in the new context block of the JWT
This commit is contained in:
parent
4a84388f15
commit
4e942203cb
2 changed files with 34 additions and 2 deletions
|
@ -95,7 +95,11 @@ def get_granted_entity():
|
|||
return GrantedEntity(user=user)
|
||||
|
||||
if kind == 'token':
|
||||
return GrantedEntity(token=context.get('token'))
|
||||
token = model.token.load_token_data(context.get('token'))
|
||||
if not token:
|
||||
return None
|
||||
|
||||
return GrantedEntity(token=token)
|
||||
|
||||
if kind == 'oauth':
|
||||
user = model.user.get_user(context.get('user', ''))
|
||||
|
@ -142,7 +146,7 @@ def build_context_and_subject(user, token, oauthtoken):
|
|||
if token:
|
||||
context = {
|
||||
'kind': 'token',
|
||||
'token': token,
|
||||
'token': token.code,
|
||||
}
|
||||
return (context, None)
|
||||
|
||||
|
|
Reference in a new issue