aboutsummaryrefslogtreecommitdiff
path: root/gn_auth
diff options
context:
space:
mode:
Diffstat (limited to 'gn_auth')
-rw-r--r--gn_auth/auth/authentication/oauth2/views.py5
-rw-r--r--gn_auth/templates/base.html32
2 files changed, 34 insertions, 3 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):
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
@@ -10,12 +10,40 @@
<link rel="stylesheet" type="text/css"
href="https://genenetwork.org/static/new/css/bootstrap-custom.css" />
<link rel="stylesheet" type="text/css"
+ href="https://genenetwork.org/static/new/css/non-responsive.css" />
+ <link rel="stylesheet" type="text/css"
href="{{url_for('static', filename='css/styles.css')}}" />
+ <link rel="stylesheet" type="text/css"
+ href="https://genenetwork.org/static/new/css/docs.css" />
+ <link rel="stylesheet" type="text/css"
+ href="https://genenetwork.org/static/new/css/colorbox.css" />
+ <link rel="stylesheet" type="text/css"
+ href="https://genenetwork.org/static/new/css/parsley.css" />
+ <link rel="stylesheet" type="text/css"
+ href="https://genenetwork.org/static/new/css/broken_links.css" />
+ <link rel="stylesheet"
+ href="https://genenetwork.org/static/new/css/autocomplete.css" />
+
{%block css%}{%endblock%}
</head>
- <body>
- <h1>gn-auth: {%block pagetitle%}{%endblock%}</h1>
+ <body style="width: 100%">
+ <div class="navbar navbar-inverse navbar-static-top pull-left"
+ role="navigation"
+ style="width: 100%; min-width: 850px; white-space: nowrap">
+ <div class="container-fluid" style="width: 100%;">
+ <ul class="nav navbar-nav">
+ <li>
+ <a href="{{source_uri or 'https://genenetwork.org/'}}"
+ title="Back to main GeneNetwork site."
+ style="font-weight: bold;">GeneNetwork</a>
+ </li>
+ <li>
+ <a href="#">gn-auth: {%block pagetitle%}{%endblock%}</a>
+ </li>
+ </ul>
+ </div>
+ </div>
<div class="container">
{%block content%}{%endblock%}