UI Refinments Auth Improvments

This commit is contained in:
Christopher
2026-01-22 12:23:15 -08:00
parent 812a986d0f
commit 3c904997fa
3 changed files with 50 additions and 13 deletions
+24 -5
View File
@@ -10,6 +10,7 @@ export default function LoginPage() {
const [mode, setMode] = useState<'login' | 'register'>('login'); const [mode, setMode] = useState<'login' | 'register'>('login');
const [email, setEmail] = useState(''); const [email, setEmail] = useState('');
const [password, setPassword] = useState(''); const [password, setPassword] = useState('');
const [confirmPassword, setConfirmPassword] = useState('');
const [handle, setHandle] = useState(''); const [handle, setHandle] = useState('');
const [displayName, setDisplayName] = useState(''); const [displayName, setDisplayName] = useState('');
const [error, setError] = useState(''); const [error, setError] = useState('');
@@ -18,6 +19,12 @@ export default function LoginPage() {
const handleSubmit = async (e: React.FormEvent) => { const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault(); e.preventDefault();
setError(''); setError('');
if (mode === 'register' && password !== confirmPassword) {
setError('Passwords do not match');
return;
}
setLoading(true); setLoading(true);
try { try {
@@ -198,13 +205,25 @@ export default function LoginPage() {
required required
minLength={8} minLength={8}
/> />
{mode === 'register' && (
<p style={{ fontSize: '12px', color: 'var(--foreground-tertiary)', marginTop: '4px' }}>
Minimum 8 characters
</p>
)}
</div> </div>
{mode === 'register' && (
<div style={{ marginBottom: '24px' }}>
<label style={{ display: 'block', marginBottom: '6px', fontSize: '14px', fontWeight: 500 }}>
Confirm Password
</label>
<input
type="password"
className="input"
value={confirmPassword}
onChange={(e) => setConfirmPassword(e.target.value)}
placeholder="••••••••"
required
minLength={8}
/>
</div>
)}
<button <button
type="submit" type="submit"
className="btn btn-primary btn-lg" className="btn btn-primary btn-lg"
+20 -2
View File
@@ -315,13 +315,31 @@ export default function MigrationPage() {
<label style={{ fontSize: '13px', color: 'var(--foreground-tertiary)', display: 'block', marginBottom: '6px' }}> <label style={{ fontSize: '13px', color: 'var(--foreground-tertiary)', display: 'block', marginBottom: '6px' }}>
Export file Export file
</label> </label>
<div style={{ position: 'relative' }}>
<input <input
type="file" type="file"
id="import-file-input"
accept=".json" accept=".json"
onChange={(e) => setImportFile(e.target.files?.[0] || null)} onChange={(e) => setImportFile(e.target.files?.[0] || null)}
className="input" style={{ display: 'none' }}
style={{ padding: '8px' }}
/> />
<label
htmlFor="import-file-input"
className="input"
style={{
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
cursor: 'pointer',
color: importFile ? 'var(--foreground)' : 'var(--foreground-tertiary)'
}}
>
<span>{importFile ? importFile.name : 'Select export file...'}</span>
<span className="btn btn-ghost btn-sm" style={{ pointerEvents: 'none' }}>
Browse
</span>
</label>
</div>
</div> </div>
<div style={{ marginBottom: '20px' }}> <div style={{ marginBottom: '20px' }}>
+1 -1
View File
@@ -53,7 +53,7 @@ export default function SettingsPage() {
Security Security
</div> </div>
<div style={{ color: 'var(--foreground-secondary)', fontSize: '14px' }}> <div style={{ color: 'var(--foreground-secondary)', fontSize: '14px' }}>
Change password, manage sessions Change password
</div> </div>
</Link> </Link>