You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the first and second case, return a different, more explicit message in: No account matching email and password found.. The same message must be returned in both cases to mitigate brute force attacks that try and guess users' emails.
In the case an error is thrown, omit the try/catch block here, let the error middleware take care of it.
Should become something like the following code.
constuser=ctx.request.bodyconstusersController=newAccountsController(ctx.logger,verifiedAccount,pwnedCheckerRoot)constresponse=awaitusersController.get(user.email)if(!response)thrownewAccountNotFound()constpasswordsMatch=awaitverify(user.password,response.password)// if we refactor verifyif(!passwordsMatch)thrownewAccountNotFound()consttoken=awaitgetToken(user.email,Token.Login)ctx.body={ token,issuer: response.issuer}
The text was updated successfully, but these errors were encountered:
Login currently returns
Resource Not Found
for anything that isn't a success case, for example:frost-api/src/api/accounts/Login.ts
Lines 18 to 39 in 58135e7
For the first and second case, return a different, more explicit message in:
No account matching email and password found.
. The same message must be returned in both cases to mitigate brute force attacks that try and guess users' emails.In the case an error is thrown, omit the
try/catch
block here, let the error middleware take care of it.Should become something like the following code.
The text was updated successfully, but these errors were encountered: