From 688e40edd37855d0863ab67c6c649de1605aae80 Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Sun, 15 Mar 2026 14:21:18 -0700 Subject: [PATCH] Fix: Add dashboard redirect on successful login --- app/page.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/page.js b/app/page.js index 784a973..f897b46 100644 --- a/app/page.js +++ b/app/page.js @@ -1,14 +1,16 @@ 'use client'; import { useState, useRef } from 'react'; +import { useRouter } from 'next/navigation'; // TODO: We should use this Kalshi green accent (#28CC95) all over the code. export default function LoginPage() { - const[email, setEmail] = useState(''); + const router = useRouter(); + const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); - const[captcha, setCaptcha] = useState(''); + const [captcha, setCaptcha] = useState(''); const [error, setError] = useState(''); - const[success, setSuccess] = useState(''); + const [success, setSuccess] = useState(''); const captchaImgRef = useRef(null); const refreshCaptcha = () => { @@ -35,6 +37,8 @@ export default function LoginPage() { setCaptcha(''); } else { setSuccess(data.message); + // Whisk Master away to the dashboard! + router.push('/dashboard'); } };