From 161591405b304f56a7242c3a0f80a1daf3cce77f Mon Sep 17 00:00:00 2001 From: Darin Kelkhoff Date: Tue, 10 Sep 2024 10:51:21 -0500 Subject: [PATCH] CE-1654 - do chicken-egg session before the OTHER call to finalizeCustomizeSession too... --- .../Auth0AuthenticationModule.java | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/modules/authentication/implementations/Auth0AuthenticationModule.java b/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/modules/authentication/implementations/Auth0AuthenticationModule.java index baa1be72..8b871ac1 100644 --- a/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/modules/authentication/implementations/Auth0AuthenticationModule.java +++ b/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/modules/authentication/implementations/Auth0AuthenticationModule.java @@ -247,10 +247,7 @@ public class Auth0AuthenticationModule implements QAuthenticationModuleInterface ////////////////////////////////////////////////////////////// // allow customizer to do custom things here, if so desired // ////////////////////////////////////////////////////////////// - if(getCustomizer() != null) - { - getCustomizer().finalCustomizeSession(qInstance, qSession); - } + finalCustomizeSession(qInstance, qSession); return (qSession); } @@ -311,14 +308,7 @@ public class Auth0AuthenticationModule implements QAuthenticationModuleInterface ////////////////////////////////////////////////////////////// // allow customizer to do custom things here, if so desired // ////////////////////////////////////////////////////////////// - if(getCustomizer() != null) - { - QContext.withTemporaryContext(QContext.capture(), () -> - { - QContext.setQSession(getChickenAndEggSession()); - getCustomizer().finalCustomizeSession(qInstance, qSession); - }); - } + finalCustomizeSession(qInstance, qSession); return (qSession); } @@ -364,6 +354,23 @@ public class Auth0AuthenticationModule implements QAuthenticationModuleInterface + /*************************************************************************** + ** + ***************************************************************************/ + private void finalCustomizeSession(QInstance qInstance, QSession qSession) + { + if(getCustomizer() != null) + { + QContext.withTemporaryContext(QContext.capture(), () -> + { + QContext.setQSession(getChickenAndEggSession()); + getCustomizer().finalCustomizeSession(qInstance, qSession); + }); + } + } + + + /******************************************************************************* ** Insert a session as a new record into userSession table *******************************************************************************/