Skip to content

pr request for useSendPasswordResetEmail hook + docs #217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 26, 2022

Conversation

mparsakia
Copy link
Contributor

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);
    } 
  

@chrisbianca
Copy link
Contributor

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

@suntudo
Copy link

suntudo commented Mar 31, 2022

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
Copy link

suntudo commented Apr 15, 2022

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.

@chrisbianca chrisbianca merged commit cc386c1 into CSFrequency:master Oct 26, 2022
@chrisbianca
Copy link
Contributor

@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

@Crocsx
Copy link

Crocsx commented Jan 1, 2024

I think this is also needed for useSendEmailVerification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants