miniature-sunset-64101
05/18/2023, 2:46 PM{
"id": "browser_location_change_required",
"code": 422,
"status": "Unprocessable Entity",
"reason": "In order to complete this flow please redirect the browser to: /ui/settings?flow=cba299f7-a581-487c-95ee-9cd0a374c671",
"message": "browser location change required"
}
How can I make this not redirect to /ui/settings?flow={flow_id} and instead redirect the user to a custom ui where they can change the password on for example 'http://localhost:3000/recovery/set-password?flow={flow_id}'?
All the other flows are working as expected but this recovery flow is being a problem child and the API docs don't quite explain what I need to do for each step of the process?
Currently I do the following:
Step 1 (on /recovery/send-email
) :
const ory_recovery_flow_response = await oryApiClient.createBrowserRecoveryFlow();
Step 2 (on /recovery/verify-code
):
oryApiClient..updateRecoveryFlow(FLOW_ID_FROM_PREVIOUS_RESPONSE, {
method: 'code',
csrf_token: CSRF_TOKEN_FROM_PREVIOUS_RESPONSE,
email: RECOVERY_EMAIL
}, undefined, COOKIE_STRING))();
Where undefined
above is the token
which I do not have, and do not know how to obtain.
Step 3 (on /recovery/confirmation
):
oryApiClient..updateRecoveryFlow(FLOW_ID_FROM_PREVIOUS_RESPONSE, {
method: 'code',
csrf_token: CSRF_TOKEN_FROM_PREVIOUS_RESPONSE,
code: CODE_RECIEVED_IN_EMAIL
}, undefined, COOKIE_STRING))();
But, then ERROR
{
"id": "browser_location_change_required",
"code": 422,
"status": "Unprocessable Entity",
"reason": "In order to complete this flow please redirect the browser to: /ui/settings?flow=cba299f7-a581-487c-95ee-9cd0a374c671",
"message": "browser location change required"
}
^ It's at this point where I understand that:
1. The email was sent (and I received it)
2. The code was submitted and is valid
3. But then what am I supposed to do? I expect to then reset the password, but I'm told to redirect to the UI, even though we're not using the pre-built UI
PS: Even if I do redirect to the pre-built UI, it starts the recovery flow all over again with a new email 🤔
Please assist, I feel like I've been here before during my client-side implementation and solved it, but can't remember how...miniature-sunset-64101
05/18/2023, 3:25 PM/account-settings
page, think it's fine now, will revert back tomorrownarrow-flower-8731
05/19/2023, 12:52 PMnarrow-flower-8731
05/19/2023, 12:58 PM"Set-Cookies"
in the response's Headers
to use in the Settings
flow as your user session mechanism for changing the password.miniature-sunset-64101
05/19/2023, 2:52 PM