caelum0x f80b04ae0f feat(ritgram): move GitGram app into railyard as Ritgram, next to Rithub
Moved later/gitgram-ai/gitgram/ to apps/ritgram/ (fresh history; full history stays in caelum0x/gitgram).
AITimeMachine stays separate in later/gitgram-ai per the Rithub master plan.
Logs, pid files and env files are ignored; GPL-3.0 mobile/proximity noted in THIRD_PARTY_NOTICES.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-13 04:18:46 +03:00

88 lines
2.6 KiB
TypeScript

'use client'
import { useState } from 'react'
import { useRouter } from 'next/navigation'
import Link from 'next/link'
import { authService } from '@/services/authService'
import { getErrorMessage } from '@/utils/error'
export default function ForgotPasswordPage() {
const router = useRouter()
const [email, setEmail] = useState('')
const [loading, setLoading] = useState(false)
const [error, setError] = useState('')
const [success, setSuccess] = useState(false)
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault()
setError('')
setLoading(true)
try {
await authService.forgotPassword(email)
setSuccess(true)
} catch (err: unknown) {
setError(getErrorMessage(err))
} finally {
setLoading(false)
}
}
if (success) {
return (
<div className="w-full max-w-md mx-auto px-4 py-8 text-center">
<h1 className="text-2xl font-bold text-foreground mb-4">Check your email</h1>
<p className="text-foreground/70 mb-6">
We've sent a password reset link to {email}
</p>
<Link href="/login" className="text-accent hover:underline">
Back to login
</Link>
</div>
)
}
return (
<div className="w-full max-w-md mx-auto px-4 py-8">
<h1 className="text-3xl font-bold text-foreground mb-2">Reset Password</h1>
<p className="text-foreground/70 mb-8">Enter your email to receive a reset link</p>
<form onSubmit={handleSubmit} className="space-y-4">
{error && (
<div className="bg-red-500/10 border border-red-500 text-red-500 px-4 py-3 rounded">
{error}
</div>
)}
<div>
<label htmlFor="email" className="block text-sm font-medium text-foreground mb-2">
Email
</label>
<input
id="email"
type="email"
value={email}
onChange={(e) => setEmail(e.target.value)}
required
className="w-full px-4 py-2 bg-surface border border-border rounded-lg text-foreground focus:outline-none focus:ring-2 focus:ring-accent"
/>
</div>
<button
type="submit"
disabled={loading}
className="w-full bg-accent text-white py-2 px-4 rounded-lg font-semibold hover:opacity-90 disabled:opacity-50"
>
{loading ? 'Sending...' : 'Send Reset Link'}
</button>
</form>
<div className="mt-6 text-center">
<Link href="/login" className="text-accent hover:underline">
Back to login
</Link>
</div>
</div>
)
}