mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-05 23:42:40 +00:00
introduce strict rate limitso on auth router endpoints
This commit is contained in:
parent
d6fdb38c22
commit
b7df0b122d
6 changed files with 236 additions and 99 deletions
|
|
@ -75,6 +75,14 @@ export async function verifyTotp(
|
|||
)
|
||||
);
|
||||
user = res;
|
||||
|
||||
const validPassword = await verifyPassword(
|
||||
password,
|
||||
user.passwordHash!
|
||||
);
|
||||
if (!validPassword) {
|
||||
return next(unauthorized());
|
||||
}
|
||||
}
|
||||
|
||||
if (!user) {
|
||||
|
|
@ -91,14 +99,6 @@ export async function verifyTotp(
|
|||
);
|
||||
}
|
||||
|
||||
const validPassword = await verifyPassword(
|
||||
password,
|
||||
user.passwordHash!
|
||||
);
|
||||
if (!validPassword) {
|
||||
return next(unauthorized());
|
||||
}
|
||||
|
||||
if (user.type !== UserType.Internal) {
|
||||
return next(
|
||||
createHttpError(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue