-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Correct auth login rate limit routes (#4698)
* Use fully qualified auth paths for rate limiter * Add playwright rate limiter test * Disable auth rate limits in ITs * Format w/ prettier
- Loading branch information
1 parent
8892180
commit e79a54c
Showing
7 changed files
with
58 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { expect, test } from "@playwright/test"; | ||
|
||
test("that login gets rate limited after too many attempts", async ({ page }) => { | ||
await page.goto("/login"); | ||
await page.waitForURL("**/login"); | ||
|
||
const email = `fakeuser@localhost.com`; | ||
// Add the user | ||
await page.getByLabel("Email").fill(email); | ||
await page.getByLabel("Password *", { exact: true }).fill("not-a-password"); | ||
|
||
const numberOfAttempts = 10; | ||
for (let i = 0; i < numberOfAttempts; i++) { | ||
await page.getByRole("button", { name: "Login" }).click(); | ||
} | ||
await expect(page.getByText("Too many requests. Please try again later.")).toBeVisible(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters