Fix login failure after connection
Addresses an issue where login fails with a "Unexpected end of JSON input" error after a successful Supabase connection.
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 } from "lucide-react";
|
||||
import { ArrowRight, Mail, KeyRound, Eye, EyeOff, AlertTriangle } from "lucide-react";
|
||||
|
||||
interface LoginFormProps {
|
||||
email: string;
|
||||
@@ -29,6 +29,11 @@ const LoginForm: React.FC<LoginFormProps> = ({
|
||||
loginError,
|
||||
handleLogin
|
||||
}) => {
|
||||
// CORS 또는 JSON 관련 오류인지 확인
|
||||
const isCorsOrJsonError = loginError &&
|
||||
(loginError.includes('JSON') || loginError.includes('CORS') ||
|
||||
loginError.includes('프록시') || loginError.includes('서버 응답'));
|
||||
|
||||
return (
|
||||
<div className="neuro-flat p-8 mb-6">
|
||||
<form onSubmit={handleLogin}>
|
||||
@@ -71,8 +76,21 @@ const LoginForm: React.FC<LoginFormProps> = ({
|
||||
</div>
|
||||
|
||||
{loginError && (
|
||||
<div className="p-3 bg-red-50 text-red-600 rounded-md text-sm">
|
||||
<p>{loginError}</p>
|
||||
<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">
|
||||
<AlertTriangle className="h-5 w-5 flex-shrink-0 mt-0.5 text-amber-500" />
|
||||
<div>
|
||||
<p className="font-medium">{loginError}</p>
|
||||
|
||||
{isCorsOrJsonError && (
|
||||
<ul className="mt-2 list-disc pl-5 text-xs space-y-1 text-amber-700">
|
||||
<li>설정 페이지에서 다른 CORS 프록시 유형을 시도해 보세요.</li>
|
||||
<li>HTTPS URL을 사용하는 Supabase 인스턴스로 변경해 보세요.</li>
|
||||
<li>네트워크 연결 상태를 확인하세요.</li>
|
||||
</ul>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user