fix: add missing auth hooks for gacha and dimentorin builds
Added missing React Query hooks that were being imported but not exported: - usePostLogin - usePostRegister - usePostVerifyEmail - usePostSendOtp - useGoogleCallback These hooks wrap the existing auth API functions with React Query's useMutation. Fixes build errors: - gacha:build - "usePostVerifyEmail" is not exported - dimentorin:build - "useGoogleCallback" is not exported 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude
parent
1cb2443b58
commit
31736cc403
@@ -1,7 +1,41 @@
|
|||||||
import { supabase } from '../../supabase';
|
import { supabase } from '../../supabase';
|
||||||
|
import { useMutation } from '@tanstack/react-query';
|
||||||
|
import * as authApi from '../../api/auth';
|
||||||
|
|
||||||
export * from './use-auth-store';
|
export * from './use-auth-store';
|
||||||
|
|
||||||
|
// React Query hooks for auth API
|
||||||
|
export const usePostLogin = () => {
|
||||||
|
return useMutation({
|
||||||
|
mutationFn: authApi.postLogin,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const usePostRegister = () => {
|
||||||
|
return useMutation({
|
||||||
|
mutationFn: authApi.postRegister,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const usePostVerifyEmail = () => {
|
||||||
|
return useMutation({
|
||||||
|
mutationFn: authApi.postVerifyEmail,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const usePostSendOtp = () => {
|
||||||
|
return useMutation({
|
||||||
|
mutationFn: authApi.postSendOtp,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const useGoogleCallback = () => {
|
||||||
|
return useMutation({
|
||||||
|
mutationFn: ({ code, state }: { code: string; state: string }) =>
|
||||||
|
authApi.postGoogleCallback(code, state),
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// Supabase GitHub OAuth hook
|
// Supabase GitHub OAuth hook
|
||||||
export const useGitHubAuth = () => {
|
export const useGitHubAuth = () => {
|
||||||
const signInWithGitHub = async () => {
|
const signInWithGitHub = async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user