Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/react/src/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export { useDeleteUserMutation } from "./useDeleteUserMutation";
// useReauthenticateWithRedirectMutation
export { useReloadMutation } from "./useReloadMutation";
// useSendEmailVerificationMutation
export { useSendEmailVerificationMutation } from "./useSendEmailVerificationMutation";
// useUnlinkMutation
// useUpdateEmailMutation
// useUpdatePasswordMutation
Expand Down
Empty file.
26 changes: 26 additions & 0 deletions packages/react/src/auth/useSendEmailVerificationMutation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { useMutation, type UseMutationOptions } from "@tanstack/react-query";
import {
type ActionCodeSettings,
type AuthError,
sendEmailVerification,
type User,
} from "firebase/auth";

type AuthMutationOptions<
TData = unknown,
TError = Error,
TVariables = void
> = Omit<UseMutationOptions<TData, TError, TVariables>, "mutationFn"> & {
actionCodeSettings?: ActionCodeSettings | null;
};

export function useSendEmailVerificationMutation(
user: User,
options?: AuthMutationOptions<void, AuthError, ActionCodeSettings | null>
) {
return useMutation<void, AuthError, ActionCodeSettings | null>({
...options,
mutationFn: (actionCodeSettings?: ActionCodeSettings | null) =>
sendEmailVerification(user, actionCodeSettings),
});
}
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading