To make my question simple, I am trying to redirect verified cognito users back to my website once they verify their email by clicking on verification link. Which I implemented using this question and this amazing tutorial. This is working magically as there is no redirect URI option available in cogntio verification link. The issue I am facing when I have multiple environment setup for development, testing, staging and production (also localhost). In this case I want to redirect my user back to original site where they have registered and not on a static link.
Asked
Active
Viewed 250 times
0
-
How about saving the redirect uri as custom user attribute in cognito when user is created? – Ninad Gaikwad Aug 11 '21 at 05:58
-
Where is the option to add that? when the email itself is sent by the lambda function. There is no parameter in that lambda function from which url user requested to register on the website. – AbhimanuSharma Aug 11 '21 at 17:35
-
As soon as user is created you are able to update their attributes. You simply need the username and userpoolid and your lambda needs to have permission to make adminupdateuserattributes call. https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_AdminUpdateUserAttributes.html – Ninad Gaikwad Aug 12 '21 at 06:13