From 590889c29c558ca6c67b9020095e5c5ff21629a8 Mon Sep 17 00:00:00 2001 From: Eduardo Robles Elvira Date: Mon, 22 Apr 2024 14:31:49 +0200 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=90=9E=20smartlink=20as=20alternative?= =?UTF-8?q?=20auth=20method?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Parent issue: https://github.com/sequentech/meta/issues/221 --- avRegistration/login-directive/login-directive.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avRegistration/login-directive/login-directive.js b/avRegistration/login-directive/login-directive.js index e5d2929c..a941cb0b 100644 --- a/avRegistration/login-directive/login-directive.js +++ b/avRegistration/login-directive/login-directive.js @@ -808,7 +808,7 @@ angular.module('avRegistration') * @param {*} altAuthMethod altAuthMethod object */ scope.getAltAuthMethodName = function(altAuthMethod) { - var langCode = $window.i18n.lng(); + var langCode = $window.i18next.language; if ( altAuthMethod.public_name_i18n && altAuthMethod.public_name_i18n[langCode] From 2c0226c0096a2d40391085acdb20b1bb2d704c6e Mon Sep 17 00:00:00 2001 From: Eduardo Robles Elvira Date: Mon, 22 Apr 2024 15:29:15 +0200 Subject: [PATCH 2/4] allowing smart link --- avRegistration/login-directive/login-directive.js | 10 +--------- dist/appCommon-v10.3.0.js | 6 +++--- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/avRegistration/login-directive/login-directive.js b/avRegistration/login-directive/login-directive.js index a941cb0b..3bb1ef93 100644 --- a/avRegistration/login-directive/login-directive.js +++ b/avRegistration/login-directive/login-directive.js @@ -808,7 +808,7 @@ angular.module('avRegistration') * @param {*} altAuthMethod altAuthMethod object */ scope.getAltAuthMethodName = function(altAuthMethod) { - var langCode = $window.i18next.language; + var langCode = $window.i18next.resolvedLanguage; if ( altAuthMethod.public_name_i18n && altAuthMethod.public_name_i18n[langCode] @@ -839,14 +839,6 @@ angular.module('avRegistration') return; } - // smart link cannot be enabled if it doesn't come from the url - if ( - scope.selectedAltMethod !== 'smart-link' && - altAuthMethod.auth_method_name === 'smart-link' - ) { - return; - } - scope.current_alt_auth_method_id = altAuthMethod.id; authevent.extra_fields = altAuthMethod.extra_fields; authevent.auth_method_config = altAuthMethod.auth_method_config; diff --git a/dist/appCommon-v10.3.0.js b/dist/appCommon-v10.3.0.js index 4a79dec6..d36e42fe 100644 --- a/dist/appCommon-v10.3.0.js +++ b/dist/appCommon-v10.3.0.js @@ -660,15 +660,15 @@ angular.module("avRegistration").config(function() {}), angular.module("avRegist var params = $window.location.href, paramName2 = paramName2.replace(/[\[\]]/g, "\\$&").replace(/ /g, "%20"), params = new RegExp("[?&]" + paramName2 + "(=([^&#]*)|&|#|$)").exec(params); return params ? params[2] ? decodeURIComponent(params[2].replace(/\+/g, " ")) || void 0 : "" : null; }, scope.getAltAuthMethodName = function(altAuthMethod) { - var langCode = $window.i18n.lng(); + var langCode = $window.i18next.resolvedLanguage; return altAuthMethod.public_name_i18n && altAuthMethod.public_name_i18n[langCode] ? altAuthMethod.public_name_i18n[langCode] : altAuthMethod.public_name; }, scope.setCurrentAltAuthMethod = function(altAuthMethod) { var authevent = angular.copy(scope.base_authevent); if (null === altAuthMethod) return scope.current_alt_auth_method_id = null, scope.isOpenId = scope.isOpenId || "openid-connect" === authevent.auth_method, void scope.apply(authevent); - altAuthMethod.id !== scope.current_alt_auth_method_id && ("smart-link" !== scope.selectedAltMethod && "smart-link" === altAuthMethod.auth_method_name || (scope.current_alt_auth_method_id = altAuthMethod.id, + altAuthMethod.id !== scope.current_alt_auth_method_id && (scope.current_alt_auth_method_id = altAuthMethod.id, authevent.extra_fields = altAuthMethod.extra_fields, authevent.auth_method_config = altAuthMethod.auth_method_config, - authevent.auth_method = altAuthMethod.auth_method_name, scope.apply(authevent))); + authevent.auth_method = altAuthMethod.auth_method_name, scope.apply(authevent)); }, scope.apply = function(authevent) { scope.hasOtpFieldsCode = Authmethod.hasOtpCodeField(authevent), scope.method = authevent.auth_method, scope.oidc_providers = authevent.oidc_providers, scope.current_oidc_providers = getCurrentOidcProviders(authevent), From 27afea0561a7aa8d25e1964cc32eae7ba1955ee3 Mon Sep 17 00:00:00 2001 From: Eduardo Robles Elvira Date: Mon, 22 Apr 2024 15:55:44 +0200 Subject: [PATCH 3/4] WIP --- avRegistration/login-directive/login-directive.html | 4 ++-- avRegistration/login-directive/login-directive.js | 11 ++++++++++- dist/appCommon-v10.3.0.js | 8 ++++---- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/avRegistration/login-directive/login-directive.html b/avRegistration/login-directive/login-directive.html index 2066f3f7..01090685 100644 --- a/avRegistration/login-directive/login-directive.html +++ b/avRegistration/login-directive/login-directive.html @@ -35,7 +35,7 @@ '), $templateCache.put("avRegistration/loading.html", '

'), $templateCache.put("avRegistration/login-controller/login-controller.html", ''), - $templateCache.put("avRegistration/login-directive/login-directive.html", '
'), + $templateCache.put("avRegistration/login-directive/login-directive.html", ''), $templateCache.put("avRegistration/register-controller/register-controller.html", '
'), $templateCache.put("avRegistration/register-directive/register-directive.html", '

avRegistration.fillValidFormText
'), $templateCache.put("avRegistration/success.html", '

'), From dddc3c12faeaf5e5c1fef4b6271e1d0c0d4d59f1 Mon Sep 17 00:00:00 2001 From: Eduardo Robles Elvira Date: Mon, 22 Apr 2024 16:17:13 +0200 Subject: [PATCH 4/4] WIP --- avRegistration/login-directive/login-directive.html | 4 ++-- avRegistration/login-directive/login-directive.js | 2 +- dist/appCommon-v10.3.0.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/avRegistration/login-directive/login-directive.html b/avRegistration/login-directive/login-directive.html index 01090685..00e3a5ce 100644 --- a/avRegistration/login-directive/login-directive.html +++ b/avRegistration/login-directive/login-directive.html @@ -35,7 +35,7 @@
-