aboutsummaryrefslogtreecommitdiff
path: root/gn_auth/auth/authentication/oauth2
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-04-26 10:08:05 +0300
committerFrederick Muriuki Muriithi2024-04-26 10:08:05 +0300
commit0f8adc98579820c3899c9f3fdd883a0c018c6022 (patch)
treeadea05392b5b77d40b2094643213becfb58e9058 /gn_auth/auth/authentication/oauth2
parenta19ad9852945fe882be1231b727b6687bccd0b37 (diff)
downloadgn-auth-0f8adc98579820c3899c9f3fdd883a0c018c6022.tar.gz
UX: use correct class for flash messages.
Diffstat (limited to 'gn_auth/auth/authentication/oauth2')
-rw-r--r--gn_auth/auth/authentication/oauth2/views.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/gn_auth/auth/authentication/oauth2/views.py b/gn_auth/auth/authentication/oauth2/views.py
index 52f3346..7600ada 100644
--- a/gn_auth/auth/authentication/oauth2/views.py
+++ b/gn_auth/auth/authentication/oauth2/views.py
@@ -41,7 +41,8 @@ def authorise():
request.form.get("client_id", str(uuid.uuid4()))))
client = server.query_client(client_id)
if not bool(client):
- flash("Invalid OAuth2 client.", "alert-error")
+ flash("Invalid OAuth2 client.", "alert-danger")
+
if request.method == "GET":
client = server.query_client(request.args.get("client_id"))
return render_template(
@@ -64,15 +65,15 @@ def authorise():
user = user_by_email(conn, email["email"])
if valid_login(conn, user, form.get("user:password", "")):
return server.create_authorization_response(request=request, grant_user=user)
- flash(email_passwd_msg, "alert-error")
+ flash(email_passwd_msg, "alert-danger")
return redirect_response # type: ignore[return-value]
except EmailNotValidError as _enve:
app.logger.debug(traceback.format_exc())
- flash(email_passwd_msg, "alert-error")
+ flash(email_passwd_msg, "alert-danger")
return redirect_response # type: ignore[return-value]
except NotFoundError as _nfe:
app.logger.debug(traceback.format_exc())
- flash(email_passwd_msg, "alert-error")
+ flash(email_passwd_msg, "alert-danger")
return redirect_response # type: ignore[return-value]
return with_db_connection(__authorise__)