Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐞 smartlink as alternative auth method #390

Merged
merged 4 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions avRegistration/login-directive/login-directive.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<!-- Shows the alternative auth method tabs in case there's any -->
<div class="col-sm-12 alternative-auth-methods-tabs" ng-if="alternative_auth_methods">
<ul class="nav nav-tabs">
<ul class="nav nav-tabs" ng-if="method !== 'smart-link'">
<li
class="default-auth-method"
ng-class="{'active': current_alt_auth_method_id == null}"
Expand All @@ -53,7 +53,7 @@
ng-repeat="alt_auth_method in alternative_auth_methods"
ng-class="{'active': current_alt_auth_method_id == alt_auth_method.id, 'disabled': selectedAltMethod !== 'smart-link' && alt_auth_method.auth_method_name === 'smart-link'}"
>
<a ng-click="setCurrentAltAuthMethod(alt_auth_method)">
<a ng-click="setCurrentAltAuthMethod(alt_auth_method, true)">
<i
ng-if="alt_auth_method.icon"
class="{{alt_auth_method.icon}}"
Expand Down Expand Up @@ -97,7 +97,7 @@
<button
type="submit"
class="btn btn-block btn-lg btn-success-action"
ng-if="!isCensusQuery && !isOtl"
ng-if="!isCensusQuery && !isOtl && method !== 'smart-link'"
ng-i18next="avRegistration.loginButton"
ng-click="loginUser(form.$valid)"
tabindex="0"
Expand Down
7 changes: 4 additions & 3 deletions avRegistration/login-directive/login-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ angular.module('avRegistration')
{
scope.error = error;
scope.errorData = angular.toJson({
support: '<a href="mailto:' + ConfigService.contact.email + '" target="_blank">' + ConfigService.contact.email + "</a>"
support: ConfigService.contact.email
});
if (scope.isOpenId) {
setOIDCErrorCookie(errorCodename);
Expand Down Expand Up @@ -808,7 +808,7 @@ angular.module('avRegistration')
* @param {*} altAuthMethod altAuthMethod object
*/
scope.getAltAuthMethodName = function(altAuthMethod) {
var langCode = $window.i18n.lng();
var langCode = $window.i18next.resolvedLanguage;
if (
altAuthMethod.public_name_i18n &&
altAuthMethod.public_name_i18n[langCode]
Expand All @@ -823,7 +823,7 @@ angular.module('avRegistration')
* Sets the current alt auth method
* @param {*} altAuthMethod altAuthMethod object
*/
scope.setCurrentAltAuthMethod = function(altAuthMethod) {
scope.setCurrentAltAuthMethod = function(altAuthMethod, isClick) {
var authevent = angular.copy(scope.base_authevent);
if (altAuthMethod === null) {
scope.current_alt_auth_method_id = null;
Expand All @@ -841,6 +841,7 @@ angular.module('avRegistration')

// smart link cannot be enabled if it doesn't come from the url
if (
!!isClick &&
scope.selectedAltMethod !== 'smart-link' &&
altAuthMethod.auth_method_name === 'smart-link'
) {
Expand Down
Loading
Loading