mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
fix(cognito): prefer phone delivery for signup verification (#1839)
Signed-off-by: Vinod Kumar <codingkiddo@gmail.com>
This commit is contained in:
1 parent
8f3597c205
commit
2f435fd1c9
2 files changed
+57
-13
No files matched your search
@@ -2488,19 +2488,15 @@ public class CognitoService {
|
||||
List<String> autoVerifiedAttributes =
|
||||
pool.getAutoVerifiedAttributes() != null ? pool.getAutoVerifiedAttributes()
|
||||
: List.of();
|
||||
for (String attribute : autoVerifiedAttributes) {
|
||||
if ("email".equals(attribute)) {
|
||||
String email = blankToNull(attributes.get("email"));
|
||||
if (email != null) {
|
||||
return new DeliveryTarget("email", "EMAIL", maskEmail(email));
|
||||
}
|
||||
}
|
||||
if ("phone_number".equals(attribute)) {
|
||||
String phoneNumber = blankToNull(attributes.get("phone_number"));
|
||||
if (phoneNumber != null) {
|
||||
return new DeliveryTarget("phone_number", "SMS", maskPhoneNumber(phoneNumber));
|
||||
}
|
||||
}
|
||||
|
||||
String phoneNumber = blankToNull(attributes.get("phone_number"));
|
||||
if (autoVerifiedAttributes.contains("phone_number") && phoneNumber != null) {
|
||||
return new DeliveryTarget("phone_number", "SMS", maskPhoneNumber(phoneNumber));
|
||||
}
|
||||
|
||||
String email = blankToNull(attributes.get("email"));
|
||||
if (autoVerifiedAttributes.contains("email") && email != null) {
|
||||
return new DeliveryTarget("email", "EMAIL", maskEmail(email));
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in new issue
Block a user