mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 22:11:36 -05:00
fix(cognito): return sub UUID as UserSub in SignUp response (#351)
The SignUp handler was returning the username (email) as UserSub instead of the generated UUID. Real AWS Cognito returns the user's immutable sub attribute, and SDKs/terraform rely on this to get a stable identifier. CognitoService.signUp already generates and stores the sub UUID on the user, so the fix is a one-line handler change plus a handler-level test that asserts UserSub is a UUID, not the username. Fixes #346
This commit is contained in:
2 files changed
+34
-1
No files matched your search
@@ -352,7 +352,7 @@ public class CognitoJsonHandler {
|
||||
);
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
response.put("UserConfirmed", "CONFIRMED".equals(user.getUserStatus()));
|
||||
response.put("UserSub", user.getUsername());
|
||||
response.put("UserSub", user.getAttributes().get("sub"));
|
||||
ObjectNode delivery = response.putObject("CodeDeliveryDetails");
|
||||
delivery.put("AttributeName", "email");
|
||||
delivery.put("DeliveryMedium", "EMAIL");
|
||||
|
||||
Reference in new issue
Block a user