34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import { redirect } from "next/navigation";
|
|
import { loginAction } from "@/lib/actions";
|
|
import { getSession } from "@/lib/auth";
|
|
|
|
export default async function LoginPage() {
|
|
const session = await getSession();
|
|
|
|
if (session) {
|
|
redirect("/");
|
|
}
|
|
|
|
return (
|
|
<div className="grid">
|
|
<section className="panel" style={{ maxWidth: 520 }}>
|
|
<h2 className="section-title">Sign In</h2>
|
|
<p className="section-copy">Use the bootstrap admin credentials configured through environment variables.</p>
|
|
<form action={loginAction} className="form-grid">
|
|
<div className="form-row">
|
|
<label htmlFor="email">Email</label>
|
|
<input className="input" id="email" name="email" type="email" required />
|
|
</div>
|
|
<div className="form-row">
|
|
<label htmlFor="password">Password</label>
|
|
<input className="input" id="password" name="password" type="password" required />
|
|
</div>
|
|
<button className="button" type="submit">
|
|
Sign In
|
|
</button>
|
|
</form>
|
|
</section>
|
|
</div>
|
|
);
|
|
}
|