diff --git a/memento-note/app/(auth)/forgot-password/page.tsx b/memento-note/app/(auth)/forgot-password/page.tsx index deb0dc1..4a3c9b7 100644 --- a/memento-note/app/(auth)/forgot-password/page.tsx +++ b/memento-note/app/(auth)/forgot-password/page.tsx @@ -1,79 +1,113 @@ -'use client' +'use client'; -import { useState } from 'react' -import { Button } from '@/components/ui/button' -import { Input } from '@/components/ui/input' -import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@/components/ui/card' -import { forgotPassword } from '@/app/actions/auth-reset' -import { toast } from 'sonner' -import Link from 'next/link' -import { useLanguage } from '@/lib/i18n' +import { useState } from 'react'; +import { forgotPassword } from '@/app/actions/auth-reset'; +import { toast } from 'sonner'; +import Link from 'next/link'; +import { Mail, ArrowRight, Sparkles, ArrowLeft } from 'lucide-react'; +import { useLanguage } from '@/lib/i18n'; export default function ForgotPasswordPage() { - const { t } = useLanguage() - const [isSubmitting, setIsSubmitting] = useState(false) - const [isDone, setIsSubmittingDone] = useState(false) + const { t } = useLanguage(); + const [isSubmitting, setIsSubmitting] = useState(false); + const [isDone, setIsDone] = useState(false); const handleSubmit = async (e: React.FormEvent) => { - e.preventDefault() - setIsSubmitting(true) - const formData = new FormData(e.currentTarget) - const result = await forgotPassword(formData.get('email') as string) - setIsSubmitting(false) + e.preventDefault(); + setIsSubmitting(true); + const formData = new FormData(e.currentTarget); + const result = await forgotPassword(formData.get('email') as string); + setIsSubmitting(false); if (result.error) { - toast.error(result.error) + toast.error(result.error); } else { - setIsSubmittingDone(true) + setIsDone(true); } - } + }; if (isDone) { return ( -
- - - {t('auth.checkYourEmail')} - +
+
+
+ +
+
+

{t('auth.checkYourEmail')}

+

{t('auth.resetEmailSent')} - - - - - - - - -

- ) +

+ + + + + + + ); } return ( -
- - - {t('auth.forgotPasswordTitle')} - +
+
+
+

+ {t('auth.forgotPasswordTitle')} +

+

{t('auth.forgotPasswordDescription')} - - -

- -
- - +

+
+ + +
+ +
+
+ +
+
- - - - - {t('auth.backToLogin')} - - +
+ + - -
- ) + +
+ + + {t('auth.backToLogin')} + +
+ + + ); } diff --git a/memento-note/app/(auth)/layout.tsx b/memento-note/app/(auth)/layout.tsx index a70d6b8..9af7813 100644 --- a/memento-note/app/(auth)/layout.tsx +++ b/memento-note/app/(auth)/layout.tsx @@ -1,6 +1,8 @@ 'use client'; import { LanguageProvider } from '@/lib/i18n/LanguageProvider'; +import Link from 'next/link'; +import { Globe } from 'lucide-react'; export default function AuthLayout({ children, @@ -9,10 +11,38 @@ export default function AuthLayout({ }>) { return ( -
-
- {children} -
+
+
+
+ +
+ +
+ +
+ + + +
+ M +
+ Momento + + +
+
+ +
+
+ {children} +

+ © 2025 Momento Labs +

+
+
); diff --git a/memento-note/app/(auth)/login/page.tsx b/memento-note/app/(auth)/login/page.tsx index 923c951..d110fac 100644 --- a/memento-note/app/(auth)/login/page.tsx +++ b/memento-note/app/(auth)/login/page.tsx @@ -1,17 +1,9 @@ import { LoginForm } from '@/components/login-form'; import { getSystemConfig } from '@/lib/config'; - + export default async function LoginPage() { const config = await getSystemConfig(); - - // Default to true unless explicitly disabled in DB or Env const allowRegister = config.ALLOW_REGISTRATION !== 'false' && process.env.ALLOW_REGISTRATION !== 'false'; - return ( -
-
- -
-
- ); + return ; } diff --git a/memento-note/app/(auth)/register/page.tsx b/memento-note/app/(auth)/register/page.tsx index 3994364..a62de53 100644 --- a/memento-note/app/(auth)/register/page.tsx +++ b/memento-note/app/(auth)/register/page.tsx @@ -1,7 +1,7 @@ import { RegisterForm } from '@/components/register-form'; import { getSystemConfig } from '@/lib/config'; import { redirect } from 'next/navigation'; - + export default async function RegisterPage() { const config = await getSystemConfig(); const allowRegister = config.ALLOW_REGISTRATION !== 'false' && process.env.ALLOW_REGISTRATION !== 'false'; @@ -10,11 +10,5 @@ export default async function RegisterPage() { redirect('/login'); } - return ( -
-
- -
-
- ); + return ; } diff --git a/memento-note/app/(auth)/reset-password/page.tsx b/memento-note/app/(auth)/reset-password/page.tsx index 4d56df1..9d40776 100644 --- a/memento-note/app/(auth)/reset-password/page.tsx +++ b/memento-note/app/(auth)/reset-password/page.tsx @@ -1,98 +1,156 @@ -'use client' +'use client'; -import { useState, Suspense } from 'react' -import { Button } from '@/components/ui/button' -import { Input } from '@/components/ui/input' -import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@/components/ui/card' -import { resetPassword } from '@/app/actions/auth-reset' -import { toast } from 'sonner' -import { useSearchParams, useRouter } from 'next/navigation' -import Link from 'next/link' -import { useLanguage } from '@/lib/i18n' +import { useState, Suspense } from 'react'; +import { resetPassword } from '@/app/actions/auth-reset'; +import { toast } from 'sonner'; +import { useSearchParams, useRouter } from 'next/navigation'; +import Link from 'next/link'; +import { Lock, ArrowRight, Sparkles, AlertCircle, ArrowLeft } from 'lucide-react'; +import { useLanguage } from '@/lib/i18n'; function ResetPasswordForm() { - const searchParams = useSearchParams() - const router = useRouter() - const { t } = useLanguage() - const [isSubmitting, setIsSubmitting] = useState(false) - - const token = searchParams.get('token') + const searchParams = useSearchParams(); + const router = useRouter(); + const { t } = useLanguage(); + const [isSubmitting, setIsSubmitting] = useState(false); + + const token = searchParams.get('token'); const handleSubmit = async (e: React.FormEvent) => { - e.preventDefault() - if (!token) return + e.preventDefault(); + if (!token) return; - const formData = new FormData(e.currentTarget) - const password = formData.get('password') as string - const confirm = formData.get('confirmPassword') as string + const formData = new FormData(e.currentTarget); + const password = formData.get('password') as string; + const confirm = formData.get('confirmPassword') as string; if (password !== confirm) { - toast.error(t('resetPassword.passwordMismatch')) - return + toast.error(t('resetPassword.passwordMismatch')); + return; } - setIsSubmitting(true) - const result = await resetPassword(token, password) - setIsSubmitting(false) - + setIsSubmitting(true); + const result = await resetPassword(token, password); + setIsSubmitting(false); + if (result.error) { - toast.error(result.error) + toast.error(result.error); } else { - toast.success(t('resetPassword.success')) - router.push('/login') + toast.success(t('resetPassword.success')); + router.push('/login'); } - } + }; if (!token) { return ( - - - {t('resetPassword.invalidLinkTitle')} - {t('resetPassword.invalidLinkDescription')} - - - - +
+
+
+ +
+
+

{t('resetPassword.invalidLinkTitle')}

+

{t('resetPassword.invalidLinkDescription')}

+
+ + - - - ) +
+
+ ); } return ( - - - {t('resetPassword.title')} - {t('resetPassword.description')} - -
- -
- - +
+
+
+

+ {t('resetPassword.title')} +

+

+ {t('resetPassword.description')} +

+
+ + +
+ +
+
+ +
+ +
-
- - + +
+ +
+
+ +
+ +
- - - - - - - ) + + + + +
+ + + {t('auth.backToLogin')} + +
+
+
+ ); } export default function ResetPasswordPage() { - const { t } = useLanguage() + const { t } = useLanguage(); return ( -
- {t('resetPassword.loading')}
}> - - - - ) + {t('resetPassword.loading')}
}> + + + ); } diff --git a/memento-note/components/login-form.tsx b/memento-note/components/login-form.tsx index def6d5d..ea2da54 100644 --- a/memento-note/components/login-form.tsx +++ b/memento-note/components/login-form.tsx @@ -3,18 +3,28 @@ import { useActionState } from 'react'; import { useFormStatus } from 'react-dom'; import { authenticate } from '@/app/actions/auth'; -import { Button } from '@/components/ui/button'; -import { Input } from '@/components/ui/input'; import Link from 'next/link'; +import { Mail, Lock, ArrowRight, Sparkles } from 'lucide-react'; import { useLanguage } from '@/lib/i18n'; function LoginButton() { const { pending } = useFormStatus(); const { t } = useLanguage(); return ( - + ); } @@ -23,22 +33,28 @@ export function LoginForm({ allowRegister = true }: { allowRegister?: boolean }) const { t } = useLanguage(); return ( -
-
-

- {t('auth.signInToAccount')} -

-
-
-