You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
345 B
16 lines
345 B
1 year ago
|
|
||
|
|
||
|
def jwt_response_payload_handler(token, user=None, request=None, role=None):
|
||
|
|
||
|
if user.username:
|
||
|
name = user.username
|
||
|
else:
|
||
|
name = user.username
|
||
|
return {
|
||
|
"authenticated": True,
|
||
|
'id': user.id,
|
||
|
"role": role,
|
||
|
'name': name,
|
||
|
'username': user.username,
|
||
|
'token': token,
|
||
|
}
|