amplify-js
amplify-js copied to clipboard
Redirect to url after clicking email verification link
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
Hi, is this implemented, I want to redirect, not using amplify, just cognito? Thank you :)
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.
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.
+1, otherwise UI looks really bad
+1 we want this thanks!
Any movement on this feature?
+1
Any updates?
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}®ion=${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
5-Select the already created lambda function in post confirmation
6-Save changes
7-click on the message customization in user pool cognito
7- Now here we have to change link to code
How is the internal conversation going?
Is this working?
Yes it is working