1
0
mirror of https://gitlab.com/brutaldon/brutaldon.git synced 2024-11-02 16:37:19 -04:00

Add user's acct to session on login

This commit is contained in:
Jason McBrayer 2018-05-20 20:28:53 -04:00
parent 40df8fd1fb
commit bfa9e8e86b

View File

@ -152,6 +152,8 @@ def oauth_callback(request):
redirect_uri=redirect_uri,
scopes=['read', 'write', 'follow'])
request.session['access_token'] = access_token
user = mastodon.account_verify_credentials()
request.session['user'] = user.acct
return redirect(home)
@ -204,6 +206,8 @@ def old_login(request):
account.access_token = access_token
account.save()
request.session['username'] = username
user = mastodon.account_verify_credentials()
request.session['user'] = user.acct
return redirect(home)
except: