fix(cognito): reject unconfirmed users in SRP auth (#2027)

This commit is contained in:
Aniket Shukla authored and GitHub committed 2026-08-04 21:43:08 -05:00
1 parent 76f602fafa
commit 733c72d02a
2 files changed
+46

No files matched your search

@@ -328,6 +328,9 @@ final class CognitoAuthFlowHandler {
if ("RESET_REQUIRED".equals(user.getUserStatus())) {
throw new AwsException("PasswordResetRequiredException", "Password reset required", 400);
}
if ("UNCONFIRMED".equals(user.getUserStatus())) {
throw new AwsException("UserNotConfirmedException", "User is not confirmed", 400);
}
if (user.getSrpVerifier() == null) {
throw new AwsException("NotAuthorizedException", "User does not support SRP auth", 400);
}
@@ -386,6 +389,9 @@ final class CognitoAuthFlowHandler {
if ("RESET_REQUIRED".equals(user.getUserStatus())) {
throw new AwsException("PasswordResetRequiredException", "Password reset required", 400);
}
if ("UNCONFIRMED".equals(user.getUserStatus())) {
throw new AwsException("UserNotConfirmedException", "User is not confirmed", 400);
}
if (user.getSrpVerifier() == null) {
throw new AwsException("NotAuthorizedException", "User does not support SRP auth", 400);
}