amplify-js icon indicating copy to clipboard operation
amplify-js copied to clipboard

Redirect to url after clicking email verification link 

Open saad8it opened this issue 3 years ago • 10 comments

Is this related to another service?

Cognito

Describe the feature you'd like to request

Opening the issue again previously posted by another user

When the user clicks on the email verification link, they're taken to a confirmation page, located at https://APP.auth.us-east-2.amazoncognito.com/confirmUser?client_id=CLIENT_ID&user_name=USERNAME&confirmation_code=CODE

I'd like the ability to specify a URL that the confirmation page will redirect to, thereby auto logging in the user. This will make the signup flow more streamlined. Perhaps there could be an extra parameter for the redirect url. https://APP.auth.us-east-2.amazoncognito.com/confirmUser?client_id=CLIENT_ID&user_name=USERNAME&confirmation_code=CODE&redirect=URL

The way it works now is that after clicking the link, the user has to go back to my app and log in again, which is awkward.

Describe the solution you'd like

The way it works now is that after clicking the link, the user has to go back to my app and log in again, which is awkward.

Describe alternatives you've considered

I have tried using lambda triggers but having difficulties setting it up

saad8it avatar Oct 10 '21 16:10 saad8it

Hi, is this implemented, I want to redirect, not using amplify, just cognito? Thank you :)

alexandervonwl avatar Dec 18 '22 19:12 alexandervonwl

This is really basic auth feature needed as the UX ist really bad otherwise. The workaround is terrible right now and autoSignIn is still a struggle. Come on: if you want to make amplify better and usable work on this ASAP please. It is in high demand by the amplify dev community.

ledgerdevelop avatar Mar 24 '23 15:03 ledgerdevelop

We are building a flutter app and wanted to redirect the user to the app after he clicks the confirmation link received in the email. Please consider adding this feature, indeed the UX is really bad. Still waiting for a solution, if anyone had any luck to find a workaround for this.

oantacamelia avatar Mar 27 '23 10:03 oantacamelia

+1, otherwise UI looks really bad

ghost avatar Aug 02 '23 17:08 ghost

+1 we want this thanks!

gmicek avatar Aug 17 '23 21:08 gmicek

Any movement on this feature?

BernhardSmuts avatar Oct 26 '23 04:10 BernhardSmuts

+1

clairolzam avatar Dec 19 '23 22:12 clairolzam

Any updates?

mahmoud-anwer avatar May 07 '24 18:05 mahmoud-anwer

Sorry for the late Update i did find a solution back when i was implementing (2021) and i documented the process so sharing the logic hopefully it works till now too

For verify Aws user verification customization follow the following steps

1-Create a lambda function from the following link

https://eu-central-1.console.aws.amazon.com/lambda/home?region=eu-central-1#/functions

2-After creating lambda function paste the following code into the lamda function

` exports.handler = (event, context, callback) => {

if(event.triggerSource === "CustomMessage_SignUp") {

    console.log('function triggered');
    
    console.log(event);
    
    // Ensure that your message contains event.request.codeParameter. This is the placeholder for code that will be sent
    const { codeParameter } = event.request
    
    const { userName, region } = event
    
    const { clientId } = event.callerContext
    
    const { email } = event.request.userAttributes
    
    const url = 'use the url of your app'
    
    const link = `<a href="${url}?code=${codeParameter}&username=${userName}&clientId=${clientId}&region=${region}&email=${email}" target="_blank">Verify
    </a>
    `
    
    event.response.emailSubject = "Your verification link"; // event.request.codeParameter
    
    event.response.emailMessage = `<!DOCTYPE html>
    
`

3- Go to User Pool

4-Click on the trigger option image

5-Select the already created lambda function in post confirmation image

6-Save changes

7-click on the message customization in user pool cognito

7- Now here we have to change link to code

image

saad8it avatar May 09 '24 06:05 saad8it

How is the internal conversation going?

asyschikov avatar Jun 18 '24 00:06 asyschikov

Is this working?

jmelo11 avatar Sep 25 '24 16:09 jmelo11

Yes it is working

saad8it avatar Sep 25 '24 16:09 saad8it