feat(client): magic link sign-in

Signed-off-by: Noa Virellia <noa@requiem.garden>
This commit is contained in:
2025-12-25 01:38:43 +08:00
committed by Asai Neko
parent e4e15b2f6e
commit 606c74c587
12 changed files with 167 additions and 631 deletions

View File

@@ -0,0 +1,11 @@
import { useSuspenseQuery } from '@tanstack/react-query';
import { axiosClient } from '@/lib/axios';
export function useValidateMagicLink(ticket: string) {
return useSuspenseQuery({
queryKey: ['validateMagicLink', ticket],
queryFn: async () => {
return axiosClient.get<{ jwt_token: string; email: string }>('/auth/magic/verify', { params: { token: ticket } });
},
});
}