Skip to content

Commit

Permalink
Merge pull request #34 from eitchugo/main
Browse files Browse the repository at this point in the history
set error on field emailCode instead of global
  • Loading branch information
mesutpiskin authored May 13, 2024
2 parents 13d5fb8 + 8ebdf2b commit 5a20de4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void action(AuthenticationFlowContext context) {
if (Long.parseLong(ttl) < System.currentTimeMillis()) {
// expired
context.getEvent().user(userModel).error(Errors.EXPIRED_CODE);
Response challengeResponse = challenge(context, Messages.EXPIRED_ACTION_TOKEN_SESSION_EXISTS);
Response challengeResponse = challenge(context, Messages.EXPIRED_ACTION_TOKEN_SESSION_EXISTS, EmailConstants.CODE);
context.failureChallenge(AuthenticationFlowError.EXPIRED_CODE, challengeResponse);
} else {
// valid
Expand All @@ -121,7 +121,7 @@ public void action(AuthenticationFlowContext context) {
AuthenticationExecutionModel execution = context.getExecution();
if (execution.isRequired()) {
context.getEvent().user(userModel).error(Errors.INVALID_USER_CREDENTIALS);
Response challengeResponse = challenge(context, Messages.INVALID_ACCESS_CODE);
Response challengeResponse = challenge(context, Messages.INVALID_ACCESS_CODE, EmailConstants.CODE);
context.failureChallenge(AuthenticationFlowError.INVALID_CREDENTIALS, challengeResponse);
} else if (execution.isConditional() || execution.isAlternative()) {
context.attempted();
Expand Down

0 comments on commit 5a20de4

Please sign in to comment.