mirror of
https://github.com/multipleof4/KalBot.git
synced 2026-03-17 05:51:02 +00:00
Feat: Redirect login to /paper instead of /dashboard
This commit is contained in:
33
app/page.js
33
app/page.js
@@ -2,8 +2,6 @@
|
||||
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 router = useRouter();
|
||||
const [email, setEmail] = useState('');
|
||||
@@ -37,8 +35,7 @@ export default function LoginPage() {
|
||||
setCaptcha('');
|
||||
} else {
|
||||
setSuccess(data.message);
|
||||
// Whisk Master away to the dashboard!
|
||||
router.push('/dashboard');
|
||||
router.push('/paper');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -46,15 +43,15 @@ export default function LoginPage() {
|
||||
<div className="min-h-screen flex items-center justify-center bg-gray-50 text-gray-900 font-sans">
|
||||
<div className="bg-white p-8 rounded-lg shadow-xl w-full max-w-md border border-gray-100">
|
||||
<h1 className="text-2xl font-bold mb-6 text-center text-[#28CC95]">Kalbot Access</h1>
|
||||
|
||||
|
||||
{error && <div className="bg-red-50 border border-red-200 text-red-600 p-3 rounded mb-4 text-sm">{error}</div>}
|
||||
{success && <div className="bg-green-50 border border-green-200 text-green-600 p-3 rounded mb-4 text-sm">{success}</div>}
|
||||
|
||||
<form onSubmit={handleLogin} className="space-y-4">
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 mb-1">Email</label>
|
||||
<input
|
||||
type="email"
|
||||
<input
|
||||
type="email"
|
||||
required
|
||||
className="w-full bg-white border border-gray-300 rounded px-3 py-2 focus:outline-none focus:border-[#28CC95] focus:ring-1 focus:ring-[#28CC95] transition-shadow"
|
||||
value={email}
|
||||
@@ -63,22 +60,22 @@ export default function LoginPage() {
|
||||
</div>
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 mb-1">Password</label>
|
||||
<input
|
||||
type="password"
|
||||
<input
|
||||
type="password"
|
||||
required
|
||||
className="w-full bg-white border border-gray-300 rounded px-3 py-2 focus:outline-none focus:border-[#28CC95] focus:ring-1 focus:ring-[#28CC95] transition-shadow"
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 mb-1">Captcha Verification</label>
|
||||
<div className="flex items-center space-x-3 mb-2">
|
||||
<img
|
||||
ref={captchaImgRef}
|
||||
src="/api/captcha"
|
||||
alt="captcha"
|
||||
<img
|
||||
ref={captchaImgRef}
|
||||
src="/api/captcha"
|
||||
alt="captcha"
|
||||
className="h-12 rounded cursor-pointer border border-gray-300"
|
||||
onClick={refreshCaptcha}
|
||||
title="Click to refresh"
|
||||
@@ -87,8 +84,8 @@ export default function LoginPage() {
|
||||
Refresh
|
||||
</button>
|
||||
</div>
|
||||
<input
|
||||
type="text"
|
||||
<input
|
||||
type="text"
|
||||
required
|
||||
placeholder="Enter the text above"
|
||||
className="w-full bg-white border border-gray-300 rounded px-3 py-2 focus:outline-none focus:border-[#28CC95] focus:ring-1 focus:ring-[#28CC95] transition-shadow"
|
||||
@@ -97,8 +94,8 @@ export default function LoginPage() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
<button
|
||||
type="submit"
|
||||
className="w-full bg-[#28CC95] hover:brightness-95 text-white font-bold py-2 px-4 rounded transition-all mt-6 shadow-sm"
|
||||
>
|
||||
Login
|
||||
|
||||
Reference in New Issue
Block a user