https://serverless-stack.com/ logo
#random
Title
# random
l

Lukasz K

05/06/2022, 11:27 AM
Anyone else started receiving user emails in
event.requestContext.authorizer.jwt.claims.username
in APIGWv2 with Cognito Auth? This has never worked for me in the past, kept on returning UserId (sub) but now, out of the blue it switched to email...
Oddly enough only happening for a single user in the user pool so far, rest are still returning Sub as username
f

Frank

05/07/2022, 3:43 PM
What’s
signinAlias
configured to?
Could it be the
signinAlias
is set to
username
and
email
?
l

Lukasz K

05/07/2022, 3:50 PM
Afaik I've always set it explicitly to email but never achieved the desired result 😅
I'd be ok with the outcome, if only it was consistent. But when one user logs in and gets cognitoId as username and another logs in and gets the email then I feel odd stuff is happening
Was just a rand question, don't think there's any change to SST that triggered this. I already fixed all my refs in code to
sub
just to be 100% sure of the outcome