From adb774476734b8a6e21a4da6b1d2e0ec855c65d7 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 4 Jun 2024 12:57:28 -0500 Subject: Approximate the GN2 look-and-feel. --- gn_auth/auth/authentication/oauth2/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gn_auth/auth') diff --git a/gn_auth/auth/authentication/oauth2/views.py b/gn_auth/auth/authentication/oauth2/views.py index cb49841..fc27768 100644 --- a/gn_auth/auth/authentication/oauth2/views.py +++ b/gn_auth/auth/authentication/oauth2/views.py @@ -1,6 +1,7 @@ """Endpoints for the oauth2 server""" import uuid import traceback +from urllib.parse import urlparse from authlib.oauth2.rfc6749.errors import InvalidClientError from email_validator import validate_email, EmailNotValidError @@ -45,12 +46,14 @@ def authorise(): if request.method == "GET": client = server.query_client(request.args.get("client_id")) + _src = urlparse(request.args["redirect_uri"]) return render_template( "oauth2/authorise-user.html", client=client, scope=client.scope, response_type=request.args["response_type"], - redirect_uri=request.args["redirect_uri"]) + redirect_uri=request.args["redirect_uri"], + source_uri=f"{_src.scheme}://{_src.netloc}/") form = request.form def __authorise__(conn: db.DbConnection): -- cgit v1.2.3