Remove offline mode option
This commit removes the offline mode functionality and focuses on resolving server-side issues.
This commit is contained in:
@@ -1,18 +1,17 @@
|
||||
|
||||
import { supabase } from '@/lib/supabase';
|
||||
import { handleNetworkError, parseResponse, showAuthToast, isOfflineMode, createDemoUser } from './auth.utils';
|
||||
import { handleNetworkError, parseResponse, showAuthToast, verifyServerConnection } from './auth.utils';
|
||||
|
||||
export const signIn = async (email: string, password: string) => {
|
||||
try {
|
||||
// 오프라인 모드 확인
|
||||
if (isOfflineMode()) {
|
||||
console.log('오프라인 모드로 로그인 시도:', email);
|
||||
|
||||
// 데모 사용자 생성 (데모 모드용)
|
||||
const demoUser = createDemoUser(email, email.split('@')[0]);
|
||||
|
||||
showAuthToast('로그인 성공', '오프라인 모드로 로그인되었습니다.');
|
||||
return { error: null, user: demoUser };
|
||||
// 서버 연결 상태 먼저 확인
|
||||
const connectionStatus = await verifyServerConnection();
|
||||
if (!connectionStatus.connected) {
|
||||
showAuthToast('서버 연결 실패', connectionStatus.message, 'destructive');
|
||||
return {
|
||||
error: { message: `서버 연결에 실패했습니다: ${connectionStatus.message}` },
|
||||
user: null
|
||||
};
|
||||
}
|
||||
|
||||
console.log('로그인 시도 중:', email);
|
||||
|
||||
Reference in New Issue
Block a user