react-firebase-hooks
react-firebase-hooks copied to clipboard
pr request for useSendPasswordResetEmail hook + docs
Add optional actionCodeSettings to useSendPasswordResetEmail.ts + documentation updated.
It's been a while since I've used TypeScript but I did check and make sure no warnings or errors popped up so please verify I didn't make any mistakes if you decide to merge! Thank you.
Hi! I would like to propose a change to the useSendPasswordResetEmail
hook.
Mainly, I want to be able to supply the optional actionCodeSettings
object for the firebase sendPasswordResetEmail
function: firebase v9 documented here
This way, I can supply the 'url' within the actionCodeSettings
so when a user initiates password reset, they get the "Continue"
button in the firebase dialog box after changing their password, and can be redirected to the page set in the url property: such as www.example.com/login
Example:
// actionCodeSettings can set other properties as well, in the documentation linked. For my use case on web, URL is enough.
const actionCodeSettings = {
url: "https://www.example.com/login",
};
const [sendPasswordResetEmail, sending, error] = useSendPasswordResetEmail(
auth
);
// somewhere in the code we call sendPasswordResetEmail
try {
await sendPasswordResetEmail(email, actionCodeSettings);
}
@mparsakia Thanks for this submission, it looks like a good addition to the library. I'm currently away on holiday, but will review properly when I'm back in a week or so.
Hi there, I would also really like this feature on the useSendPasswordResetEmail hook. Have you by chance had a moment to review the PR? Much appreciated and thanks for the great library.
Hi @chrisbianca, wanted to check in again whether you might be able to take a look at this PR. Also, it would be great if this functionality could be added to the useSendEmailVerification hook as well. Much appreciated.
@mparsakia Thanks for this submission and apologies for the very overdue merge. I'll be getting a new release out over the next few days
I think this is also needed for useSendEmailVerification