From 824338645922ada5a3d05c91455f89f3b645d62d Mon Sep 17 00:00:00 2001 From: Zai Shi Date: Fri, 26 Jul 2024 10:16:43 -0700 Subject: [PATCH] added better oauth error message --- .../src/app/api/v1/auth/oauth/callback/[provider]/route.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/backend/src/app/api/v1/auth/oauth/callback/[provider]/route.tsx b/apps/backend/src/app/api/v1/auth/oauth/callback/[provider]/route.tsx index 96c7105e4..051065e66 100644 --- a/apps/backend/src/app/api/v1/auth/oauth/callback/[provider]/route.tsx +++ b/apps/backend/src/app/api/v1/auth/oauth/callback/[provider]/route.tsx @@ -45,7 +45,7 @@ export const GET = createSmartRouteHandler({ cookies().delete("stack-oauth-inner-" + query.state); if (cookieInfo?.value !== 'true') { - throw new StatusError(StatusError.BadRequest, "stack-oauth-inner- cookie not found"); + throw new StatusError(StatusError.BadRequest, "OAuth cookie not found. This is likely because you have refreshed the page during the OAuth sign in process. Please try to sign in again"); } const outerInfoDB = await prismaClient.oAuthOuterInfo.findUnique({ @@ -55,7 +55,7 @@ export const GET = createSmartRouteHandler({ }); if (!outerInfoDB) { - throw new StatusError(StatusError.BadRequest, "Invalid stack-oauth-inner- cookie value. Please try signing in again."); + throw new StatusError(StatusError.BadRequest, "Invalid OAuth cookie. Please try to signing in again."); } let outerInfo: Awaited>;