aboutsummaryrefslogtreecommitdiff
path: root/gn_auth/auth/authentication
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-06-04 11:56:33 -0500
committerFrederick Muriuki Muriithi2024-06-04 11:56:33 -0500
commitbb654a8b8e21fde36b889472fa31e941b0014bc8 (patch)
tree485ad3ea7842d867a65c9013e6d1464f6c3bb661 /gn_auth/auth/authentication
parentcac3db95a11723f25f211b9349023676adf3fe29 (diff)
downloadgn-auth-bb654a8b8e21fde36b889472fa31e941b0014bc8.tar.gz
Redirect appropriately when verifying emails.
Diffstat (limited to 'gn_auth/auth/authentication')
-rw-r--r--gn_auth/auth/authentication/oauth2/views.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/gn_auth/auth/authentication/oauth2/views.py b/gn_auth/auth/authentication/oauth2/views.py
index cf815ea..cb49841 100644
--- a/gn_auth/auth/authentication/oauth2/views.py
+++ b/gn_auth/auth/authentication/oauth2/views.py
@@ -65,8 +65,12 @@ def authorise():
user = user_by_email(conn, email["email"])
if valid_login(conn, user, form.get("user:password", "")):
if not user.verified:
- return redirect(url_for(
- "oauth2.users.handle_unverified"), code=307)
+ return redirect(
+ url_for("oauth2.users.handle_unverified",
+ response_type=form["response_type"],
+ client_id=client_id,
+ redirect_uri=form["redirect_uri"]),
+ code=307)
return server.create_authorization_response(request=request, grant_user=user)
flash(email_passwd_msg, "alert-danger")
return redirect_response # type: ignore[return-value]