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 ++++- gn_auth/templates/base.html | 32 +++++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 3 deletions(-) (limited to 'gn_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): diff --git a/gn_auth/templates/base.html b/gn_auth/templates/base.html index 6238a39..b452ca1 100644 --- a/gn_auth/templates/base.html +++ b/gn_auth/templates/base.html @@ -9,13 +9,41 @@ + + + + + + + {%block css%}{%endblock%} - -

gn-auth: {%block pagetitle%}{%endblock%}

+ +
{%block content%}{%endblock%} -- cgit v1.2.3