From 25c6da03e1639895f0051e8be6502762beefde0b Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 29 May 2023 11:21:48 +0300 Subject: Enable Administrator login on GN3 * gn3/auth/authentication/oauth2/views.py: Remove endpoint * gn3/auth/authorisation/users/admin/__init__.py: New admin module * gn3/auth/authorisation/users/admin/ui.py: New admin module * gn3/auth/authorisation/users/admin/views.py: New admin module * gn3/auth/views.py: Use new admin module * gn3/errors.py: Fix linting errors * gn3/templates/login.html: New html template * main.py: Fix linting errors --- gn3/auth/authentication/oauth2/views.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'gn3/auth/authentication/oauth2') diff --git a/gn3/auth/authentication/oauth2/views.py b/gn3/auth/authentication/oauth2/views.py index f281295..7ce45fd 100644 --- a/gn3/auth/authentication/oauth2/views.py +++ b/gn3/auth/authentication/oauth2/views.py @@ -26,11 +26,6 @@ from ..users import valid_login, NotFoundError, user_by_email auth = Blueprint("auth", __name__) -@auth.route("/register-client", methods=["GET", "POST"]) -def register_client(): - """Register an OAuth2 client.""" - return "WOULD REGISTER ..." - @auth.route("/delete-client/", methods=["GET", "POST"]) def delete_client(client_id: uuid.UUID): """Delete an OAuth2 client.""" @@ -77,8 +72,8 @@ def authorise(): return with_db_connection(__authorise__) except InvalidClientError as ice: - return render_template( - "oauth2/oauth2_error.html", error=ice), ice.status_code + return render_template( + "oauth2/oauth2_error.html", error=ice), ice.status_code @auth.route("/token", methods=["POST"]) def token(): -- cgit v1.2.3