From 400f06905f05480d80348a074db3907df476fba0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20B=C3=B6ttcher?= <c.boettcher@fz-juelich.de>
Date: Tue, 7 Mar 2023 11:42:07 +0100
Subject: [PATCH] proper redirect and logging for userdata

---
 plugins/unity_integration.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/plugins/unity_integration.py b/plugins/unity_integration.py
index 91466b3..e7f7208 100644
--- a/plugins/unity_integration.py
+++ b/plugins/unity_integration.py
@@ -44,6 +44,15 @@ class UnityIntegrationView(AppBuilderBaseView):
         first_name = user["given_name"]
         last_name = user["family_name"]
         admin_access = user.get('eflows:dlsAccess', False)
+
+        log.debug("SSO user logging in...")
+        log.debug("sub : " + persistent_identifier)
+        log.debug("first name : " + first_name)
+        log.debug("last name : " + last_name)
+        log.debug("email : " + email)
+        log.debug("admin : " + admin_access)
+        log.debug("......................")
+
         role = FAB_VIEWER_ROLE
         if admin_access:
             role = FAB_ADMIN_ROLE
@@ -64,7 +73,7 @@ class UnityIntegrationView(AppBuilderBaseView):
             )
         # login as that user
         login_user(fab_user, remember=False)
-        return redirect('/')
+        return redirect(url_for('home'))
     
     @unity.route('/logout')
     def logout():
-- 
GitLab