Fixed issues logging in.

The API call to /api/bcloud/update-subscription is now performed via the
SDK, to ensure proper authentication. Also streamlined some other code.
This commit is contained in:
2017-05-05 10:29:16 +02:00
parent 10a40ddabd
commit 379d40837b
3 changed files with 17 additions and 9 deletions

View File

@@ -87,7 +87,17 @@ def login_user(oauth_token):
def get_blender_id_oauth_token():
"""Returns a tuple (token, ''), for use with flask_oauthlib."""
return session.get('blender_id_oauth_token')
from flask import request
token = session.get('blender_id_oauth_token')
if token:
return token
if request.authorization:
return request.authorization.username, ''
return None
def config_oauth_login(app):