Investigate login/register 404 errors

Investigate and address persistent 404 errors occurring during login and registration processes.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-15 15:01:48 +00:00
parent a32eb26105
commit e52ca26cef
7 changed files with 223 additions and 75 deletions

View File

@@ -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>