From b37f3c0211bbadcb32030f23749bfe28b7f129b1 Mon Sep 17 00:00:00 2001 From: Stacey Date: Wed, 31 Jan 2024 17:10:07 +0100 Subject: [PATCH] Fix for multi-locale bug --- src/Controller/ApiController.php | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/Controller/ApiController.php b/src/Controller/ApiController.php index bb74ff8..93cfe59 100644 --- a/src/Controller/ApiController.php +++ b/src/Controller/ApiController.php @@ -88,22 +88,13 @@ public function login($isSignup = false) } $extraAuth0Params = []; - $action="login"; - - // Show register tab instead of login tab - if ($isSignup === true) { - $action='signup'; - // set config param for the lock so it opens up in signup tab - if($this->config()->get('multi_locale')) { // multi_locale true sends the language of the locale - $extraAuth0Params = [ - 'auth_action' => 'signup', - 'locale' => Locale::getCurrentLocale()->Locale - ]; - } else { - $extraAuth0Params = [ - 'auth_action' => 'signup' - ]; - } + + $action = ($isSignup === true) ? "signup" : "login"; + $extraAuth0Params['auth_action'] = $action; + + // set config param for the lock so it opens up in signup tab + if($this->config()->get('multi_locale')) { // multi_locale true sends the language of the locale + $extraAuth0Params['locale'] = Locale::getCurrentLocale()->Locale; } if ($email) {