diff options
author | 2018-05-20 23:29:17 +0100 | |
---|---|---|
committer | 2018-05-20 23:29:17 +0100 | |
commit | 449d52caf4010ed112f1928bf6b5234bcfb9a339 (patch) | |
tree | 3ce59258a68fcb4174610b157f3a3ae9c50be02a /pysite/oauth.py | |
parent | Tests directory (#73) (diff) |
Privacy/Usability updates (#75)
* Use less intrusive oauth scopes, add login redirect method
* Remove debugging prints, add missing __init__
* Work towards new privacy policy
* Fix judging state icons on code jam management page
* Jammer profile retraction and punishments based on jam status
* Linting
* [Jams] Deny profile saving for users < 13 years, and finish removal page
* Fix tests
* Clean up and address Volcyy's review
* Add proper login redirection to require_roles decorator
* Fix template is_staff() and add staff link to navigation
* Address lemon's review
* Linting
* Privacy page formatting
* Privacy page formatting
Diffstat (limited to 'pysite/oauth.py')
-rw-r--r-- | pysite/oauth.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/pysite/oauth.py b/pysite/oauth.py index d025ea37..86e7cdde 100644 --- a/pysite/oauth.py +++ b/pysite/oauth.py @@ -8,7 +8,7 @@ from flask_dance.contrib.discord import discord from pysite.constants import DISCORD_API_ENDPOINT, OAUTH_DATABASE -class OauthBackend(BaseBackend): +class OAuthBackend(BaseBackend): """ This is the backend for the oauth @@ -34,7 +34,6 @@ class OauthBackend(BaseBackend): pass def set(self, blueprint, token): - user = self.get_user() sess_id = str(uuid5(uuid4(), self.key)) self.add_user(token, user, sess_id) @@ -62,8 +61,7 @@ class OauthBackend(BaseBackend): { "user_id": user_data["id"], "username": user_data["username"], - "discriminator": user_data["discriminator"], - "email": user_data["email"] + "discriminator": user_data["discriminator"] }, conflict="update" ) @@ -85,3 +83,4 @@ class OauthBackend(BaseBackend): sess_id = session.get("session_id") if sess_id and self.db.get(OAUTH_DATABASE, sess_id): # If user exists in db, self.db.delete(OAUTH_DATABASE, sess_id) # remove them (at least, their session) + session.clear() |