Skip to content

Commit

Permalink
GH-4: Style basic unauthorized page
Browse files Browse the repository at this point in the history
  • Loading branch information
markhobson committed Oct 13, 2023
1 parent 4c6bb57 commit c23f0e9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
12 changes: 10 additions & 2 deletions schemes/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
from urllib.parse import urlencode, urlparse

from authlib.integrations.flask_client import OAuth
from flask import Blueprint, Response, current_app, redirect, session, url_for
from flask import (
Blueprint,
Response,
current_app,
redirect,
render_template,
session,
url_for,
)
from werkzeug.wrappers import Response as BaseResponse

bp = Blueprint("auth", __name__)
Expand All @@ -25,7 +33,7 @@ def callback() -> BaseResponse:

@bp.route("/unauthorized")
def unauthorized() -> Response:
return Response("<h1>Unauthorized</h1>", status=401)
return Response(render_template("unauthorized.html"), status=401)


@bp.route("/logout")
Expand Down
5 changes: 5 additions & 0 deletions schemes/templates/unauthorized.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% extends "base.html" %}

{% block content %}
<h1 class="govuk-heading-xl">Unauthorized</h1>
{% endblock %}

0 comments on commit c23f0e9

Please sign in to comment.