From 39aeb140d2bfa013d55e8ba034af8e94b717cc76 Mon Sep 17 00:00:00 2001 From: jnsdls Date: Wed, 25 Sep 2024 20:18:15 +0000 Subject: [PATCH] Handle 400 error in user creation check (#4805) --- apps/dashboard/src/app/login/auth-actions.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/dashboard/src/app/login/auth-actions.ts b/apps/dashboard/src/app/login/auth-actions.ts index 9bf3f3e8768..14561b93b4a 100644 --- a/apps/dashboard/src/app/login/auth-actions.ts +++ b/apps/dashboard/src/app/login/auth-actions.ts @@ -95,7 +95,8 @@ export async function doLogin(payload: VerifyLoginPayloadParams) { }, }); // if we do not have a user, create one - if (userRes.status === 404) { + // TODO: this should only need to check for 404, but because of secretKey auth it can also be 400 error + if (userRes.status === 404 || userRes.status === 400) { const newUserRes = await fetch(`${THIRDWEB_API_HOST}/v1/account/create`, { method: "POST", headers: {