The Cognito documentation is frustratingly lacking, but I think getUser and adminGetUser return the internal Cognito username (sub - a UUIDv4) rather than the username the user logs in with.
Potentially getUser could just return the value from decodedToken.sub, but I'm less sure where adminGetUser would find the sub, since it doesn't have the access token.
The Cognito documentation is frustratingly lacking, but I think
getUser
andadminGetUser
return the internal Cognito username (sub
- a UUIDv4) rather than the username the user logs in with.Potentially
getUser
could just return the value fromdecodedToken.sub
, but I'm less sure whereadminGetUser
would find the sub, since it doesn't have the access token.