update login
This commit is contained in:
@@ -44,6 +44,7 @@ const LoginPage = () => {
|
||||
};
|
||||
|
||||
if (isLoggedIn || auth.isAuthenticated) {
|
||||
// In a real app, this would be a redirect to '/'
|
||||
return <p>Redirecting...</p>;
|
||||
}
|
||||
|
||||
@@ -54,7 +55,8 @@ const LoginPage = () => {
|
||||
<CardTitle>Login</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<form onSubmit={handleSubmit} className="space-y-4">
|
||||
{/* The form is now a div to prevent Server Action errors */}
|
||||
<div className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<label htmlFor="email">Email</label>
|
||||
<Input id="email" type="email" value={email} onChange={(e) => setEmail(e.target.value)} required />
|
||||
@@ -64,8 +66,8 @@ const LoginPage = () => {
|
||||
<Input id="password" type="password" value={password} onChange={(e) => setPassword(e.target.value)} required />
|
||||
</div>
|
||||
{error && <p className="text-sm text-red-500">{error}</p>}
|
||||
<Button type="submit" className="w-full">Login</Button>
|
||||
</form>
|
||||
<Button onClick={handleSubmit} className="w-full">Login</Button>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user