From 0dad19d651d81981457bbcbc7337505bc452f626 Mon Sep 17 00:00:00 2001 From: "Artyom V. Gorchakov" Date: Mon, 4 Mar 2024 21:15:19 +0300 Subject: [PATCH] fix: Prefer username over email --- webapp/views/student.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/views/student.py b/webapp/views/student.py index 0ecf630..31f7295 100644 --- a/webapp/views/student.py +++ b/webapp/views/student.py @@ -231,7 +231,7 @@ def login_with_lks_callback(): response = oauth.fetch_token(token_ep, authorization_response=request.url) access_token = response['access_token'] info = requests.get(userinfo_ep, headers={'Authorization': f'Bearer {access_token}'}).json() - email = info['email'] + email = info['username'] if not email: return redirect("/") student = db.students.get_by_external_email(email, 'lks')