Skip to content

Commit 5e7f321

Browse files
committed
fix: do not return invalid password when webops unavailable
1 parent bc89347 commit 5e7f321

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

  • packages/core/src/pages/api/fs/auth

packages/core/src/pages/api/fs/auth/login.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,17 @@ const handler: NextApiHandler = async (
4545
})
4646

4747
if (!webopsResponse.ok) {
48-
response.status(401).json({
48+
if (webopsResponse.status === 401 || webopsResponse.status === 403) {
49+
response.status(401).json({
50+
success: false,
51+
error: 'Invalid password',
52+
})
53+
return
54+
}
55+
56+
response.status(503).json({
4957
success: false,
50-
error: 'Invalid password',
58+
error: 'Service temporarily unavailable',
5159
})
5260
return
5361
}

0 commit comments

Comments
 (0)