-
Notifications
You must be signed in to change notification settings - Fork 127
Open
Labels
authRelated to the Auth category/pluginsRelated to the Auth category/pluginsbugSomething isn't workingSomething isn't working
Description
Before opening, please confirm:
- I have searched for duplicate or closed issues and discussions.
Language and Async Model
Not applicable
Amplify Categories
Authentication
Gradle script dependencies
// Put output below this line
Environment information
# Put output below this line
Please include any relevant guides or documentation you're referencing
No response
Describe the bug
If you sign in to a user using an email address (or phone number) as the sign in attribute when using the USER_AUTH flow then when you call Amplify.Auth.getCurrentUser().username the value returned will be the attribute to used to sign in. With all other flows the value returned is the actual username.
Reproduction steps (if applicable)
- User a userpool with email and/or phonenumber as a sign in attribute. Have USER_AUTH and USER_SRP_AUTH both enabled in the app client.
- Use an email address (or phone number) to sign in with a created user via the USER_AUTH flow.
- Call
getCurrentUser()and observe theusername. - Sign out
- Sign in to the same user using USER_SRP_AUTH.
- Call
getCurrentUser()and observe theusername.
Expected: The username is the same in both cases since it's the same user.
Actual: In USER_AUTH the username is reported as the email address, in USER_SRP_AUTH it's the username (which may be a UUID if no username was supplied at sign up).
Code Snippet
// Put your code below this line.
Log output
// Put your logs below this line
Configuration File
No response
GraphQL Schema
// Put your schema below this line
Additional information and screenshots
No response
Metadata
Metadata
Assignees
Labels
authRelated to the Auth category/pluginsRelated to the Auth category/pluginsbugSomething isn't workingSomething isn't working