Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
edulix committed Sep 30, 2023
1 parent f660a46 commit c25d6db
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
23 changes: 23 additions & 0 deletions avRegistration/login-directive/login-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,29 @@ angular.module('avRegistration')
return el;
});

// if all the login fields required on authentication that are not
// of type code have been filled and we are in email-otp or sms-otp,
// we should enable jump to currantFormStep = 1. Normally this
// already happened, but it could be that it didn't if the main
// extra_field is hidden
if (
scope.currentFormStep === 0 &&
_.contains(['email-otp', 'sms-otp'], scope.auth_method)
) {
var unfilledFields = _.filter(
fields,
function (el) {
return (
el.value === null &&
!_.contains(['otp-code', 'code'], el.type)
);
}
);
if (unfilledFields.length === 0) {
scope.currentFormStep = 1;
}
}

// if not all the fields all filled at this point, then we stop
// here. otp-code fields do not count, because loginUser
// function will send the appropiate OTP code if required
Expand Down
4 changes: 3 additions & 1 deletion dist/appCommon-v10.0.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,9 @@ angular.module("avRegistration").config(function() {}), angular.module("avRegist
el.disabled = !0) : "user_id" === el.name && "smart-link" === scope.method && (el.value = scope.user_id,
el.disabled = !0), el;
});
_.filter(fields, function(el) {
0 === scope.currentFormStep && _.contains([ "email-otp", "sms-otp" ], scope.auth_method) && 0 === _.filter(fields, function(el) {
return null === el.value && !_.contains([ "otp-code", "code" ], el.type);
}).length && (scope.currentFormStep = 1), _.filter(fields, function(el) {
return null !== el.value || "otp-code" === el.type;
}).length === scope.login_fields.length && ("openid-connect" === scope.method || scope.isOtl || scope.isCensusQuery || scope.withCode || scope.loginUser(!0));
}, scope.view = function(id) {
Expand Down

0 comments on commit c25d6db

Please sign in to comment.