Skip to content

Commit bd7790b

Browse files
authored
Pass emailVerificationOptions to sendVerification
This add the options for email verification which is needed to set redirect urls and other settings.
1 parent b05bd77 commit bd7790b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

auth/useCreateUserWithEmailAndPassword.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useState, useMemo } from 'react';
22
import firebase from 'firebase/app';
33
import { EmailAndPasswordActionHook } from './types';
44

5-
export default (auth: firebase.auth.Auth, options?:{sendEmailVerification?: boolean}): EmailAndPasswordActionHook => {
5+
export default (auth: firebase.auth.Auth, options?:{sendEmailVerification?: boolean, emailVerificationOptions?: firebase.auth.ActionCodeSettings}): EmailAndPasswordActionHook => {
66
const [error, setError] = useState<firebase.FirebaseError>();
77
const [
88
registeredUser,
@@ -18,7 +18,7 @@ export default (auth: firebase.auth.Auth, options?:{sendEmailVerification?: bool
1818
try {
1919
const user = await auth.createUserWithEmailAndPassword(email, password);
2020
if (options?.sendEmailVerification) {
21-
await user.user.sendEmailVerification()
21+
await user.user.sendEmailVerification(emailVerificationOptions)
2222
}
2323
setRegisteredUser(user);
2424
setLoading(false);

0 commit comments

Comments
 (0)