Comments (5)
@AmeenIzhac - Let me know if the suggestion about storing the username on the device works for your use case. If not, please see the questions I had asked above. Thanks.
from amplify-flutter.
If they try to sign up, it will throw an exception that the user already exists.
If they tried to sign up again - yes. Some users would attempt to sign in, not sign up. For those users this step would be skipped.
The flow you have described is more or less what the experience would be with the prebuilt Authenticator widget. The Authenticator widget (by default) opens to the Sign In page, so I think many users would attempt to sign in, and then be redirected to confirm their account. I believe after the user confirms their account there is an attempt to sign them in automatically using the username/password they entered originally so they aren't asked to enter the info again. The flow is:
- open app
- enter username/password
- enter confirmation code
- user is confirmed and signed in
If we were to store the username on the device for users that needed confirmation, they would still need to enter their password in after they confirm their account (Amplify will never store a password on the device). So the flow would be
- open app
- enter confirmation code
- enter password
- user is confirmed and signed in
It is the same number of steps and only requires one less piece of info (the username) to be entered. However, it adds friction to the flow when the user has either confirmed their account on another device, or when they want to sign in with a different user.
I think it is best to ask the user to enter their username in when the app relaunches, but if you believe a different UX is right for your app you can choose to cache the username with a package like flutter_secure_storage as mentioned.
from amplify-flutter.
Hello @AmeenIzhac - Thanks for taking the time to open the issue.
The Get Current User API only returns the user if they are signed in. This API returns data that would not exist until after sign in, such as the SignInDetails.
Next time they open the app, you want Amplify to remember their username and that their account is unconfirmed so that you can check for this on start up and immediately navigate the user to a resend email confirmation screen.
What would your expectation be if the user did want to sign up/in with a new user? Would you expect their to be an API to clear out the user that is pending confirmation?
If you would like to always bring the user back to the confirm sign in page in this scenario you could store the user's username on the device using a package such as flutter_secure_storage.
I do want to note that signIn throws a UserNotConfirmedException if the account has not been confirmed. You can catch this and redirect the user to the confirm sign in page. I understand this is not exactly what you are looking for though.
from amplify-flutter.
@Jordan-Nelson - Sorry for the late response. Thanks for your suggestion about storing the username, I will do that insha Allah.
What would your expectation be if the user did want to sign up/in with a new user? Would you expect their to be an API to clear out the user that is pending confirmation?
And yes that is what I'd expect. Because I think the most likely case is that a user would want to continue their sign up, but in the rare case they want to sign up with a different account, I'd probably have a button they can press to clear the user and go back to sign up.
So consider a scenario of a user who registers but doesn't confirm their account. If they try to sign up, it will throw an exception that the user already exists. So you catch that and then prompt them to sign in. But then when they try to sign in it will throw a UserNotConfirmedException as you mentioned. So you catch that and send them an email verification link. They confirm their email, then you try to sign them in again using the email and password they entered and it should work this time.
That's the best user journey I can think of. This seems quite long winded to me, is that what's intended?
from amplify-flutter.
Ok thanks, you've convinced me there isn't any missing neccessary functionality, but don't you think it would be a useful feature for Amplify to store the previous user and whether or not they are verified for you so you don't need to catch exceptions or use fullter_secure_storage?
from amplify-flutter.
Related Issues (20)
- How to set Public Read while uploading to files to aws. HOT 3
- [amplify_auth_cognito] type 'FetchAuthSessionFetching' is not a subtype of type 'FetchAuthSessionSuccess' in type cast HOT 3
- Feature Request: Sharing authentication state between apps from the same developer HOT 9
- How to call Admin Queries API with authorization? HOT 1
- S3 access denied when making the API call. HOT 2
- DataStore sync on Android physical devices takes very long time HOT 7
- Initial DataStore Sync Slow for Android Devices HOT 4
- fetchUserAttributes function cause toomanyrequestexception HOT 8
- AmplifyPushNotificationsPinpoint doesn't support offline configuration HOT 3
- Stuck in WebUI after authenticating with a certificate in iOS HOT 16
- Type comparison with UnderlyingExceptions might not be working as expected. HOT 8
- Update device_info_plus dependency HOT 2
- Update connectivity_plus dependency HOT 1
- Datastore without Cloud sync - Android build failing HOT 6
- Unable to get local issuer certificate when configure Amplify on Windows Devices HOT 8
- User cancelled OAuth flow error from signInWithRedirect
- Amplify confirm sign in with custom authentication flow timing out HOT 1
- Unauthorized error when Data-specific Authorization with AppSync (Datastore/GraphQL) HOT 6
- Flutter Web AmplifyAuthCognito SignOut not working HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amplify-flutter.