aboutsummaryrefslogtreecommitdiff
path: root/gn_auth/auth
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-06-04 12:57:28 -0500
committerFrederick Muriuki Muriithi2024-06-04 13:11:29 -0500
commitadb774476734b8a6e21a4da6b1d2e0ec855c65d7 (patch)
treec41b218aa607e654f03dcbdfb8bea5400630e643 /gn_auth/auth
parentd8326fa4b80b16b809c0099ac7330452e93dda54 (diff)
downloadgn-auth-adb774476734b8a6e21a4da6b1d2e0ec855c65d7.tar.gz
Approximate the GN2 look-and-feel.
Diffstat (limited to 'gn_auth/auth')
-rw-r--r--gn_auth/auth/authentication/oauth2/views.py5
1 files changed, 4 insertions, 1 deletions
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):