react-firebase-hooks icon indicating copy to clipboard operation
react-firebase-hooks copied to clipboard

pr request for useSendPasswordResetEmail hook + docs

Open mparsakia opened this issue 3 years ago • 3 comments

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 avatar Mar 02 '22 11:03 mparsakia

@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.

chrisbianca avatar Mar 04 '22 09:03 chrisbianca

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.

suntudo avatar Mar 31 '22 03:03 suntudo

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.

suntudo avatar Apr 15 '22 15:04 suntudo

@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

chrisbianca avatar Oct 26 '22 15:10 chrisbianca

I think this is also needed for useSendEmailVerification

Crocsx avatar Jan 01 '24 12:01 Crocsx