From c120ab603ae7a762befbb2715d17cd0b332c2ada Mon Sep 17 00:00:00 2001
From: Maarten de Waard <maarten@greenhost.nl>
Date: Fri, 29 Apr 2022 12:34:12 +0200
Subject: [PATCH] upgrade: make changes to be compatible with Kratos
 0.9.0-alpha.3

---
 DEVELOPMENT.md     |  2 +-
 requirements.txt   |  2 +-
 run_app.sh         |  2 +-
 web/static/base.js | 12 +++++++-----
 4 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md
index f5b4aa65..e5e605dc 100644
--- a/DEVELOPMENT.md
+++ b/DEVELOPMENT.md
@@ -236,7 +236,7 @@ cat source_env.local
 
 export HYDRA_ADMIN_URL=http://localhost:4445
 export KRATOS_PUBLIC_URL=http://localhost/api
-export KRATOS_ADMIN_URL=http://localhost:8000
+export KRATOS_ADMIN_URL=http://localhost:8000/admin
 export LOGIN_PANEL_URL=http://localhost/web
 export DATABASE_URL="mysql+pymysql://stackspin:stackspin@localhost/stackspin"
 ```
diff --git a/requirements.txt b/requirements.txt
index d4d017d9..a98cfdc4 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -31,7 +31,7 @@ tomli==1.2.3
 typing-extensions==4.1.1
 urllib3==1.26.8
 Werkzeug==2.0.3
-ory-kratos-client==0.8.0a2
+ory-kratos-client==0.9.0a2
 pymysql
 Flask-SQLAlchemy
 hydra-client
diff --git a/run_app.sh b/run_app.sh
index 4d6074a2..7710af38 100755
--- a/run_app.sh
+++ b/run_app.sh
@@ -28,7 +28,7 @@ export TOKEN_URL="https://sso.init.stackspin.net/oauth2/token"
 
 # Login facilitator paths
 export KRATOS_PUBLIC_URL=http://localhost/kratos
-export KRATOS_ADMIN_URL=http://localhost:8000
+export KRATOS_ADMIN_URL=http://localhost:8000/admin
 export HYDRA_PUBLIC_URL="https://sso.init.stackspin.net"
 export HYDRA_ADMIN_URL=http://localhost:4445
 export LOGIN_PANEL_URL=http://localhost/web/
diff --git a/web/static/base.js b/web/static/base.js
index 2b2e07f2..a98e4a0f 100644
--- a/web/static/base.js
+++ b/web/static/base.js
@@ -56,8 +56,8 @@ function flow_login() {
         url: uri,
         success: function(data) {
 
-            // Render login form (group: password)
-            var html = render_form(data, 'password');
+            // Render login form (group: profile)
+            var html = render_form(data, 'profile');
             $("#contentLogin").html(html);
 
         },
@@ -134,10 +134,12 @@ function flow_settings() {
             }
 
 
+            // FIXME: This seems to be not necessary anymore in kratos 0.9.0
+            // because they moved the password field to the profile group
             // Render the password & profile form based on the fields we got
             // from the API
-            var html = render_form(data, 'password');
-            $("#contentPassword").html(html);
+            // var html = render_form(data, 'profile');
+            // $("#contentPassword").html(html);
 
             html = render_form(data, 'profile');
             $("#contentProfile").html(html);
@@ -309,7 +311,7 @@ function getFormElement(type, name, value) {
     }
 
 
-    if (name == 'password_identifier') {
+    if (name == 'identifier') {
         return getFormInput(
                 'email',
                 name,
-- 
GitLab