Prevent crash when session['blender_id_oauth_token'] doesn't exist
This commit is contained in:
@@ -217,7 +217,11 @@ def fetch_blenderid_user() -> dict:
|
|||||||
my_log.debug('Fetching user info from %s', bid_url)
|
my_log.debug('Fetching user info from %s', bid_url)
|
||||||
|
|
||||||
credentials = current_app.config['OAUTH_CREDENTIALS']['blender-id']
|
credentials = current_app.config['OAUTH_CREDENTIALS']['blender-id']
|
||||||
oauth_token = session['blender_id_oauth_token']
|
oauth_token = session.get('blender_id_oauth_token')
|
||||||
|
if not oauth_token:
|
||||||
|
my_log.warning('no Blender ID oauth token found in user session')
|
||||||
|
return {}
|
||||||
|
|
||||||
assert isinstance(oauth_token, str), f'oauth token must be str, not {type(oauth_token)}'
|
assert isinstance(oauth_token, str), f'oauth token must be str, not {type(oauth_token)}'
|
||||||
|
|
||||||
oauth_session = OAuth2Session(
|
oauth_session = OAuth2Session(
|
||||||
|
Reference in New Issue
Block a user