mirror of
https://github.com/multipleof4/KalBot.git
synced 2026-03-17 05:51:02 +00:00
Fix: Add dashboard redirect on successful login
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
'use client';
|
'use client';
|
||||||
import { useState, useRef } from 'react';
|
import { useState, useRef } from 'react';
|
||||||
|
import { useRouter } from 'next/navigation';
|
||||||
|
|
||||||
// TODO: We should use this Kalshi green accent (#28CC95) all over the code.
|
// TODO: We should use this Kalshi green accent (#28CC95) all over the code.
|
||||||
|
|
||||||
export default function LoginPage() {
|
export default function LoginPage() {
|
||||||
|
const router = useRouter();
|
||||||
const [email, setEmail] = useState('');
|
const [email, setEmail] = useState('');
|
||||||
const [password, setPassword] = useState('');
|
const [password, setPassword] = useState('');
|
||||||
const [captcha, setCaptcha] = useState('');
|
const [captcha, setCaptcha] = useState('');
|
||||||
@@ -35,6 +37,8 @@ export default function LoginPage() {
|
|||||||
setCaptcha('');
|
setCaptcha('');
|
||||||
} else {
|
} else {
|
||||||
setSuccess(data.message);
|
setSuccess(data.message);
|
||||||
|
// Whisk Master away to the dashboard!
|
||||||
|
router.push('/dashboard');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user