jagregory / cognito-local

Local emulator for Amazon Cognito
MIT License
278 stars 67 forks source link

Username from getUser and adminGetUser #334

Open paullallier opened 1 year ago

paullallier commented 1 year ago

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.

paullallier commented 1 year ago

I think this PR fixes it. Beware that my code might not be idiomatic...

paullallier commented 1 year ago

Oh, I see you might have patchy notifications, @jagregory, so tagging you just in case.