Overview
When users verify their email using a One-Time Passcode (OTP) and change their password, they see the following screen. From a UX standpoint, it is a dead end for the user - there is no button, link, or redirect. It seems the only option for the user is to close the browser window and go to log in again.
Applies To
- Password Reset Flow with One-Time Passcode (OTP)
Solution
Use the “Password Reset / PostChallenge” action to specify a result URL that the end-user will be redirected to after they set a new password.
Here is an example of the logic:
exports.onExecutePostChallenge = async (event, api) => {
var resultUrl = 'http://www.google.com'
console.log('Setting Result Url:', resultUrl);
api.transaction.setResultUrl(resultUrl);
};
NOTE: The code above is an example that must be customized to fit specific environments.