From f44cbf711b168286204d7f3b1409d1bf8347c0e8 Mon Sep 17 00:00:00 2001 From: "Kalana B. Thilakarathna" Date: Mon, 19 Oct 2026 02:50:06 +0530 Subject: [PATCH] feat: add toast notifications for successful and failed login attempts --- distribution_fe/app/(auth)/login/page.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/distribution_fe/app/(auth)/login/page.tsx b/distribution_fe/app/(auth)/login/page.tsx index 621ac17..a93da0c 100644 --- a/distribution_fe/app/(auth)/login/page.tsx +++ b/distribution_fe/app/(auth)/login/page.tsx @@ -7,6 +7,7 @@ import Image from 'next/image' import { Space_Grotesk } from 'next/font/google' import { useAuth } from '@/contexts/auth-context' import { getApiError } from '@/lib/api' +import { toast } from '@/components/ui/toast' import { Input } from '@/components/ui/input' import { Label } from '@/components/ui/label' import { Button } from '@/components/ui/button' @@ -32,8 +33,11 @@ export default function LoginPage() { setSubmitting(true) try { await login(identifier, password) + toast.add({ title: 'Signed in successfully', type: 'success' }) } catch (err) { - setError(getApiError(err)) + const message = getApiError(err) + setError(message) + toast.add({ title: 'Sign in failed', description: message, type: 'error' }) } finally { setSubmitting(false) } -- 2.52.0