17 lines
478 B
TypeScript
17 lines
478 B
TypeScript
import type { AuthorizeSearchParams } from '@/routes/authorize';
|
|
import { useMutation } from '@tanstack/react-query';
|
|
import { axiosClient } from '@/lib/axios';
|
|
|
|
interface GetMagicLinkPayload extends AuthorizeSearchParams {
|
|
email: string;
|
|
turnstile_token: string;
|
|
}
|
|
|
|
export function useGetMagicLink() {
|
|
return useMutation({
|
|
mutationFn: async (payload: GetMagicLinkPayload) => {
|
|
return axiosClient.post<{ status: string }>('/auth/magic', payload);
|
|
},
|
|
});
|
|
}
|