gc-wing/apps/web/src/shared/auth/AuthContext.ts

20 lines
433 B
TypeScript
Raw Normal View 히스토리

import { createContext } from 'react';
import type { User } from './types';
export interface AuthContextValue {
user: User | null;
token: string | null;
loading: boolean;
login: (googleToken: string) => Promise<void>;
devLogin?: () => void;
logout: () => void;
}
export const AuthContext = createContext<AuthContextValue>({
user: null,
token: null,
loading: true,
login: async () => {},
logout: () => {},
});