From 739b7f794c1ebbc86337c4f0f0ca987d9a610855 Mon Sep 17 00:00:00 2001
From: Mart van Santen <mart@greenhost.nl>
Date: Tue, 28 Mar 2023 22:02:13 +0800
Subject: [PATCH] Processed comments

---
 backend/MESSAGE_CODES      | 2 +-
 backend/web/login/login.py | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/backend/MESSAGE_CODES b/backend/MESSAGE_CODES
index c39bd9d9..322264fd 100644
--- a/backend/MESSAGE_CODES
+++ b/backend/MESSAGE_CODES
@@ -15,5 +15,5 @@ Kratos codes:
 Stackspin codes:
 ================
 
-S00001   Please confirm your credentials to complete this action.
+S_CONFIRM_CREDENTIALS   Please confirm your credentials to complete this action.
 
diff --git a/backend/web/login/login.py b/backend/web/login/login.py
index 60798daf..2a689ce7 100644
--- a/backend/web/login/login.py
+++ b/backend/web/login/login.py
@@ -143,12 +143,13 @@ def login():
         refresh = flow['refresh']
         if refresh:
             message = {
-                "id": "S00001",
+                "id": "S_CONFIRM_CREDENTIALS",
                 "message": "Please confirm your credentials to complete this action.",
                 "type": "info"
             }
+            messages.append(message)
         try:
-            for msg in flow.ui.messages.value:
+            for msg in flow.ui.messages.value2:
                 current_app.logger.info("Kratos message:" + msg.text)
                 if msg.id == 4000006:
                     message = {
@@ -170,7 +171,7 @@ def login():
                 messages.append(message)
 
         except Exception as ex:
-            current_app.logger.error(ex)
+            current_app.logger.info("No messages in kratos flow to push to UI")
 
     if identity and not refresh:
         # We are already logged in, and don't need to refresh.
-- 
GitLab