Email Verification and Password Reset support continueUrl#220
Email Verification and Password Reset support continueUrl#220jeromegamez merged 3 commits intobeste:masterfrom
Conversation
| return $this->request('getOobConfirmationCode', [ | ||
| 'requestType' => 'VERIFY_EMAIL', | ||
| 'idToken' => $idToken, | ||
| 'continueUrl' => $continueUrl, |
There was a problem hiding this comment.
Please wrap the array in array_filter(...) to avoid sending an empty continueUrlfield if none is set (the small things :D)
There was a problem hiding this comment.
If I do that, am I OK to move the array to a var and add in the URL if not null instead (or use array filter instead of the if check below for future changes? Otherwise I'll have to add the array_filter inside the function and have a custom function so it doesn't remove an ID token of '0' which will look a bit messy?
$data = [
'requestType' => 'VERIFY_EMAIL',
'idToken' => $idToken,
];
if ($continueUrl !== null) {
$data['continueUrl'] = $continueUrl;
}
return $this->request('getOobConfirmationCode', $data);There was a problem hiding this comment.
Wrapping it with array_filter() really is sufficient - a value of '0' would be rejected by the Firebase REST API anyways.
There was a problem hiding this comment.
That's the User UID, not the continue URL ^^
There was a problem hiding this comment.
And that explains my confusion - this function has a token not a UID so by this point it would never be a UID. For some reason I had it in my head this function had the user ID!
| return $this->request('getOobConfirmationCode', [ | ||
| 'email' => $email, | ||
| 'requestType' => 'PASSWORD_RESET', | ||
| 'continueUrl' => $continueUrl, |
There was a problem hiding this comment.
Please wrap the array in array_filter(...) to avoid sending an empty continueUrlfield if none is set (the small things :D)
|
Thanks @wadewomersley! I will update the documentation and create a new release soon. |

Adds support for continueUrl to reset password and verify email emails that go out as per https://firebase.google.com/docs/auth/custom-email-handler