How to redirect user to a custom website when user verifies from email verification link?

1

I have been trying to implement aws cognito in my react application. I can successfully sign in and login a user. My issue is after email verification link is sent to email and user verifies it, it always redirects to a default page. I have already defined a callback url in the app client setting. But I am still redirected to that default page. Any suggestions? TIA

noobdev
질문됨 2년 전2213회 조회
2개 답변
0

Unfortunately this isn't "natively" supported by the amplify-js library. See this Github issue for more information on that. However, there is a clever work-around involving API gateway and a lambda. For a detailed description of that, see this Medium post as well as this StackOverflow answer.

profile pictureAWS
답변함 2년 전
0

Cognito allows you to configure your User Pool to send an email to your users when they attempt to register an account. You can configure this email to contain a link to Cognito's Hosted UI where the user's account will be marked as confirmed.

This trigger template allows you to define an email message with a link to a static S3 bucket that you control, where the user's account will be confirmed and they can then be redirected to a URL of your choice (presumably your application).

Below URL has a sample React code on how you can achieve that .

https://docs.amplify.aws/cli/usage/lambda-triggers/#email-verification-link-with-redirect

profile pictureAWS
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠