Update user.py

This commit is contained in:
Nile Walker 2021-02-12 09:43:30 -05:00 committed by GitHub
parent 35773ebc29
commit ab3453a70e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -214,7 +214,12 @@ def _handle_login(user_info: LdapModel, redirect_url=None):
g.user = user
# Return the frontend auth callback URL, with auth token appended.
auth_token = user.encode_auth_token()#.decode()
auth_token = user.encode_auth_token()
if type(auth_token) != str:
try:
auth_token = auth_token.decode()
except:
raise(ValueError("ValueError Auth Token not understood"))
g.token = auth_token
if redirect_url is not None: