-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto signin after signup not working #13666
Comments
https://docs.amplify.aws/react/build-a-backend/auth/connect-your-frontend/sign-up/ You'll have to call Please refer to the documentation that I just shared |
I've already tried it actually and I get the following error:
I this this is due to the fact that when I want to sign in the user after the signup, the user is not confirmed yet, I would like to sign in the user after the sign up but before the verification step |
@Ladvace yes your understanding is correct. I guess in your case, you might want to consider to use AdminConfirmSignUp |
yeah I came across this, is there a way to achieve this via amplify? or is this something that I have to do on the backend? |
You might want to look into Pre Sign Up lambda trigger. |
thanks, I'll check it out |
Hello, @Ladvace and thanks for opening this issue. As @dylan-tabist stated above, the default behavior for a basic auth flow in Amplify will require a user to sign up, get confirmed, then be signed in. If you're looking to bypass this middle step for a quicker sign up/sign in process for users, then the customizing the pre-sign up lambda can allow for this. Thanks @dylan-tabist for proving some community help here! |
Actually, wanted to follow up on this with a little more relevant information. While the Pre Sign Up Lambda trigger will work (as referenced in comments above), you can also circumvent paying for that compute cost with this auto-verify policy: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.UserPool.html#autoverify You can use in the following way for a Gen 2 app (it will leverage the L1 Construct):
Depending on the use case here, you may want to conditionally autoverify (for example if they come from a "verified" domain) which is where that trigger comes in handy. While all this can be done, also want to be clear that this runs the risk of allowing absolutely anyone into your app as verified/confirmed. |
thanks for the answer, I'm gonna try it out |
@Ladvace, just wanted to ping you and follow up to see if you had a chance to try this out. Let us know if you're still blocked here or have further questions. |
Hi, in the end, I opted for an easier solution, I just merged the login and verification steps, after the verification step, I log in the user, It's not 100% optimal but it's the easiest in my case I think |
Hi @cwomack , I have a similar issue. on confirmation I get this response:
but when I call await autoSignIn(). I get this same error :
|
there is hardly any documentation on how to handle the email verification process when the user is sent a link and not a confirmation code. is the link process case also handled by After clicking the verification link, do we run there is only one mention of how to implement in the docs and it hardly goes over any implementation details:
what is the flow to be implemented when using a confirmation link? |
I am also unsure how I invoke |
After signup with |
the docs state that this can be returned after
so either the docs or you are wrong :/ |
Read this. The autoSignIn API will automatically sign-in a user when it was previously enabled by the signUp API and after any of the following cases has completed: User confirmed their account with a verification code sent to their phone or email (default option). This means you must confirmUser. keyword |
I have read this several times and quoted it 5 comments above.
The quote from the docs mentions defining
In AWS Cognito I've set up confirmation to be specific implementation details for a user signing up and confirming their email address with a link would be greatly appreciated |
Hello all. Sorry for any confusion when using the
@oznekenzo in order to enable
|
@israx awesome - that worked - thank you very very much sticking point was how to correctly configure the config passed to Amplify - I had seen some examples where both the auto created config ( |
Thanks @oznekenzo for bringing that up. I created a task in our backlog to add specific documentation to address this use case. |
Hi @israx Thank you for your feed back. from confirmSignup I get { "isSignUpComplete": true, "nextStep": { "signUpStep": "COMPLETE_AUTO_SIGN_IN" } } but when I call await autoSignIn(). I get this same error : AutoSignInException: The autoSignIn flow has not started, or has been cancelled/completed. |
Hello @yinka0136. Could you please share code snippets about how you are calling the |
@israx just to clarify before I send the snippet, do you mean that , Signup, confirmSignup and autologin have to be called on the same tab? |
Yes. The 3 APIs should share the same context. You can still call these APIs on the same tab but using different routes. e.g |
Hi @israx I have the same issue, this is my code snippet for testing, for the nextStep. I already get COMPLETE_AUTO_SIGN_IN status but somehow when call autoSignIn() get the error AutoSignInException: The autoSignIn flow has not started, or has been cancelled/completed.
|
Hi @yinka0136 , do you solve the issue? |
@Ladvace, @firliilhami, @yinka0136, and anyone else following this issue/experiencing this, just wanted to follow up here and let you all know that we've created a docs issue (see link below) to try and prevent the confusion captured in this issue with the Typically, we'll close the |
@israx @cwomack Commenting regarding #13666 (comment)
|
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
Authentication
Amplify Version
v6
Amplify Categories
auth
Backend
Amplify Gen 2 (Preview)
Environment information
Describe the bug
as in this issue #991, the
autoSignIn
parameters in the signUp function doesn't work, the user doesn't get logged in, this is quite annoying and it makes the library almost unusable for me.An issue for this already exist but got closed.
Expected behavior
to sign in after the signup is successful
Reproduction steps
just sign in
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: