Investigate login/register 404 errors
Investigate and address persistent 404 errors occurring during login and registration processes.
This commit is contained in:
@@ -4,7 +4,7 @@ import { Link } from "react-router-dom";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { ArrowRight, Mail, KeyRound, Eye, EyeOff, AlertTriangle, Loader2, WifiOff } from "lucide-react";
|
||||
import { ArrowRight, Mail, KeyRound, Eye, EyeOff, AlertTriangle, Loader2, WifiOff, Wifi } from "lucide-react";
|
||||
|
||||
interface LoginFormProps {
|
||||
email: string;
|
||||
@@ -39,7 +39,8 @@ const LoginForm: React.FC<LoginFormProps> = ({
|
||||
const isCorsOrJsonError = loginError &&
|
||||
(loginError.includes('JSON') || loginError.includes('CORS') ||
|
||||
loginError.includes('프록시') || loginError.includes('서버 응답') ||
|
||||
loginError.includes('네트워크'));
|
||||
loginError.includes('네트워크') ||
|
||||
loginError.includes('404') || loginError.includes('Not Found'));
|
||||
|
||||
const toggleOfflineMode = () => {
|
||||
if (setIsOfflineMode) {
|
||||
@@ -90,6 +91,27 @@ const LoginForm: React.FC<LoginFormProps> = ({
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Button
|
||||
type="button"
|
||||
onClick={toggleOfflineMode}
|
||||
variant={isOfflineMode ? "destructive" : "outline"}
|
||||
className="w-full mb-3 flex items-center justify-center py-2"
|
||||
>
|
||||
{isOfflineMode ? (
|
||||
<>
|
||||
<WifiOff className="h-4 w-4 mr-2" />
|
||||
오프라인 모드 활성화됨 (클릭하여 비활성화)
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Wifi className="h-4 w-4 mr-2" />
|
||||
온라인 모드 활성화됨 (클릭하여 오프라인 모드로 전환)
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{loginError && (
|
||||
<div className={`p-3 ${isCorsOrJsonError ? 'bg-amber-50 text-amber-800' : 'bg-red-50 text-red-600'} rounded-md text-sm`}>
|
||||
<div className="flex items-start gap-2">
|
||||
@@ -97,7 +119,7 @@ const LoginForm: React.FC<LoginFormProps> = ({
|
||||
<div>
|
||||
<p className="font-medium">{loginError}</p>
|
||||
|
||||
{isCorsOrJsonError && (
|
||||
{isCorsOrJsonError && !isOfflineMode && (
|
||||
<ul className="mt-2 list-disc pl-5 text-xs space-y-1 text-amber-700">
|
||||
<li>설정 페이지에서 다른 CORS 프록시 유형을 시도해 보세요.</li>
|
||||
<li>HTTPS URL을 사용하는 Supabase 인스턴스로 변경해 보세요.</li>
|
||||
@@ -123,13 +145,9 @@ const LoginForm: React.FC<LoginFormProps> = ({
|
||||
<div>
|
||||
<p className="font-medium">오프라인 모드 활성화됨</p>
|
||||
<p className="text-xs mt-1">서버 없이 앱의 기본 기능을 사용할 수 있습니다. 데이터는 로컬에 저장됩니다.</p>
|
||||
<button
|
||||
type="button"
|
||||
onClick={toggleOfflineMode}
|
||||
className="text-neuro-income hover:underline text-xs mt-1"
|
||||
>
|
||||
온라인 모드로 전환
|
||||
</button>
|
||||
<p className="text-xs mt-1 text-blue-600">
|
||||
<strong>중요:</strong> 404 오류가 계속 발생한다면 오프라인 모드를 사용해보세요.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user