Skip to content

Commit 39aeb14

Browse files
committed
Handle 400 error in user creation check (#4805)
1 parent 8e9d13c commit 39aeb14

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apps/dashboard/src/app/login/auth-actions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ export async function doLogin(payload: VerifyLoginPayloadParams) {
9595
},
9696
});
9797
// if we do not have a user, create one
98-
if (userRes.status === 404) {
98+
// TODO: this should only need to check for 404, but because of secretKey auth it can also be 400 error
99+
if (userRes.status === 404 || userRes.status === 400) {
99100
const newUserRes = await fetch(`${THIRDWEB_API_HOST}/v1/account/create`, {
100101
method: "POST",
101102
headers: {

0 commit comments

Comments
 (0)