diff --git a/schemes/auth.py b/schemes/auth.py index ea6ee2ad..d5a29bf0 100644 --- a/schemes/auth.py +++ b/schemes/auth.py @@ -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__) @@ -25,7 +33,7 @@ def callback() -> BaseResponse: @bp.route("/unauthorized") def unauthorized() -> Response: - return Response("

Unauthorized

", status=401) + return Response(render_template("unauthorized.html"), status=401) @bp.route("/logout") diff --git a/schemes/templates/unauthorized.html b/schemes/templates/unauthorized.html new file mode 100644 index 00000000..e6c74463 --- /dev/null +++ b/schemes/templates/unauthorized.html @@ -0,0 +1,5 @@ +{% extends "base.html" %} + +{% block content %} +

Unauthorized

+{% endblock %}