From 31736cc403cde5eb96882b5bad6018d5be5b46f6 Mon Sep 17 00:00:00 2001 From: Maulana Sodiqin Date: Tue, 25 Nov 2025 09:49:51 +0700 Subject: [PATCH] fix: add missing auth hooks for gacha and dimentorin builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- libs/service/src/hooks/auth/index.ts | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/libs/service/src/hooks/auth/index.ts b/libs/service/src/hooks/auth/index.ts index 2d9002e..b37cbf7 100644 --- a/libs/service/src/hooks/auth/index.ts +++ b/libs/service/src/hooks/auth/index.ts @@ -1,7 +1,41 @@ import { supabase } from '../../supabase'; +import { useMutation } from '@tanstack/react-query'; +import * as authApi from '../../api/auth'; 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 export const useGitHubAuth = () => { const signInWithGitHub = async () => {