verification emails and full email setup

This commit is contained in:
2026-01-29 00:43:24 +00:00
parent 14520618d1
commit d943561e89
31 changed files with 2190 additions and 53 deletions

View File

@@ -7,3 +7,4 @@ export * from "@/lib/query/hooks/sprints";
export * from "@/lib/query/hooks/subscriptions";
export * from "@/lib/query/hooks/timers";
export * from "@/lib/query/hooks/users";
export * from "@/lib/query/hooks/verification";

View File

@@ -0,0 +1,22 @@
import { useMutation } from "@tanstack/react-query";
import { apiClient } from "@/lib/server";
export function useVerifyEmail() {
return useMutation<void, Error, { code: string }>({
mutationKey: ["verification", "verify"],
mutationFn: async ({ code }) => {
const { error } = await apiClient.authVerifyEmail({ body: { code } });
if (error) throw new Error(error);
},
});
}
export function useResendVerification() {
return useMutation<void, Error>({
mutationKey: ["verification", "resend"],
mutationFn: async () => {
const { error } = await apiClient.authResendVerification({ body: {} });
if (error) throw new Error(error);
},
});
}