diff --git a/app/login/page.tsx b/app/login/page.tsx
index 56d568d..4f5e24a 100644
--- a/app/login/page.tsx
+++ b/app/login/page.tsx
@@ -1,50 +1,83 @@
-import type { Metadata } from "next"
+"use client"
+
+import { useState } from "react"
+import { useRouter } from "next/navigation"
import Link from "next/link"
import { Button } from "@/components/ui/button"
-import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card"
+import {
+ Card,
+ CardContent,
+ CardHeader,
+ CardTitle,
+ CardDescription,
+} from "@/components/ui/card"
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
-
-export const metadata: Metadata = {
- title: "Log In",
- description: "Log in to your Higgy's Android Boxes account to access video tutorials and support.",
-}
+import { checkPassword, setAuthenticated } from "@/lib/auth"
export default function LoginPage() {
+ const [password, setPassword] = useState("")
+ const [error, setError] = useState("")
+ const [loading, setLoading] = useState(false)
+ const router = useRouter()
+
+ async function handleSubmit(e: React.FormEvent) {
+ e.preventDefault()
+ setError("")
+ setLoading(true)
+
+ const valid = await checkPassword(password)
+ if (valid) {
+ setAuthenticated(true)
+ router.push("/videos")
+ } else {
+ setError("Incorrect password. Please try again.")
+ setLoading(false)
+ }
+ }
+
return (
- Welcome back
+ Client Access
- Enter your credentials to access your video tutorials
+ Enter the password provided by Higgy to access video tutorials
-
-
-
-
-
-
-
-
-
-
-
- Don't have an account?{" "}
-
+
diff --git a/app/page.tsx b/app/page.tsx
index 9abc319..7ddf7b4 100644
--- a/app/page.tsx
+++ b/app/page.tsx
@@ -56,7 +56,7 @@ export default function HomePage() {
className="bg-[#8BC34A] hover:bg-[#7CB342] text-white"
asChild
>
- Get Started
+ Get Started