From 8bace22a9538f79aba720216106acd79af006896 Mon Sep 17 00:00:00 2001 From: Sargam Poudel Date: Sat, 7 Dec 2024 02:12:32 +0530 Subject: [PATCH 1/2] feat: add followups --- src/app/invalidsession/page.tsx | 21 ++++++++++++--------- src/middleware.ts | 1 + 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/app/invalidsession/page.tsx b/src/app/invalidsession/page.tsx index 3d178f59e..1f988184b 100644 --- a/src/app/invalidsession/page.tsx +++ b/src/app/invalidsession/page.tsx @@ -7,15 +7,18 @@ import { toast } from 'sonner'; const page = () => { useEffect(() => { - signOut({ - callbackUrl: '/signin', - }); - toast('Too many devices connected. Logging out!', { - action: { - label: 'Close', - onClick: () => toast.dismiss(), - }, - }); + (async () => { + toast('Too many devices connected. Logging out!', { + action: { + label: 'Close', + onClick: () => toast.dismiss(), + }, + }); + await new Promise((resolve) => setTimeout(resolve, 1000)); + await signOut({ + callbackUrl: '/signin', + }); + })(); }, []); return ( diff --git a/src/middleware.ts b/src/middleware.ts index 4f6585a11..e14b5af62 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -80,6 +80,7 @@ export async function middleware(req: NextRequestWithAuth) { if (pathname.startsWith('/api/mobile')) { return withMobileAuth(req); } + console.log('pathname', pathname); return await withAuth(req); } From 912c83b8869e0f29e3f0b50bb41ede2aefe6a37b Mon Sep 17 00:00:00 2001 From: Sargam Poudel Date: Sat, 7 Dec 2024 02:13:06 +0530 Subject: [PATCH 2/2] cjsdlkf --- src/middleware.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/middleware.ts b/src/middleware.ts index e14b5af62..4f6585a11 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -80,7 +80,6 @@ export async function middleware(req: NextRequestWithAuth) { if (pathname.startsWith('/api/mobile')) { return withMobileAuth(req); } - console.log('pathname', pathname); return await withAuth(req); }