diff --git a/README.md b/README.md index ae6fb6a..934824f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,13 @@ # BSL Platform +## Accessing the Admin Section + +To grant yourself admin access locally: + +1. Edit `prisma/seed.ts` and add your Google email to `SEED_USERS` with a role (`USER`, `REVIEWER`, `AMBASSADOR`, or `SUPER_ADMIN` — use `SUPER_ADMIN` for full access). +2. Run `npm run seed`. The script is idempotent, so it's safe to re-run. +3. Visit `/admin/login` and sign in with Google. + ## How to Seed Roles To assign roles to users for testing RBAC/admin features: diff --git a/app/admin/login/page.tsx b/app/admin/login/page.tsx index 0e68d59..e60a44d 100644 --- a/app/admin/login/page.tsx +++ b/app/admin/login/page.tsx @@ -1,78 +1,180 @@ -"use client"; - -import { useSession, signIn } from "next-auth/react"; -import { useRouter } from "next/navigation"; -import { useEffect } from "react"; - -export default function AdminLoginPage() { - const { data: session, status } = useSession(); - const router = useRouter(); - - useEffect(() => { - if (session) { - router.push("/admin"); - } - }, [session, router]); - - if (status === "loading" || status === "authenticated") { - return ( -
- Loading... -
- ); - } - - return ( -
-
-

- Admin Login -

- -

- Sign in to access the dashboard -

- - -
-
- ); -} +"use client"; + +import { useSession, signIn } from "next-auth/react"; +import { useRouter } from "next/navigation"; +import { useEffect } from "react"; +import Image from "next/image"; + +// TODO: confirm stats values and labels +const STATS = [ + { value: "2,418", label: "Startups Onboarded" }, + { value: "$847M", label: "Startups Onboarded" }, + { value: "326", label: "Startups Onboarded" }, +]; + +const INPUT_CLASSES = + "block w-full rounded-md border border-stone-300 bg-white px-4 py-2.5 text-sm text-stone-900 placeholder:text-stone-400 focus:outline-none focus:ring-2 focus:ring-stone-500/30"; + +const PINK_BUTTON_CLASSES = + "w-full rounded-md border border-[#D9A8A8] bg-[#F5C3C399] px-4 py-2.5 text-sm font-medium text-stone-900 transition-colors hover:bg-[#F5C3C3]"; + +export default function AdminLoginPage() { + const { data: session, status } = useSession(); + const router = useRouter(); + + useEffect(() => { + if (session) { + router.push("/admin"); + } + }, [session, router]); + + if (status === "loading" || status === "authenticated") { + return ( +
+

Loading…

+
+ ); + } + + return ( +
+ + +
+
+
+

Admin Sign In

+

+ Sign in with your authorised account. All access is logged and + audited. +

+
+ + {/* TODO: implement email/password login — fields are visual only */} +
e.preventDefault()} className="space-y-4"> +
+ + +
+ +
+ + +
+ + + + +
+ +
+
+ + or + +
+
+ + + +
+

+ This is a restricted system for authorised personnel only. + Unauthorised access attempts are logged and may be subject to + disciplinary or legal action. +

+
+
+
+
+ ); +} diff --git a/public/bsl-logo-transparent.png b/public/bsl-logo-transparent.png new file mode 100644 index 0000000..c9779b2 Binary files /dev/null and b/public/bsl-logo-transparent.png differ