-
Notifications
You must be signed in to change notification settings - Fork 430
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prevent use of common password using the haveibeenpwned password api (#…
…958) * prevent use of common password using the haveibeenpwned password api * made requested chages 1. Reduced the core logic by extracting it in custom function in auth.server.ts 2. added timeout to the request to skip the check if request takes more than 1s 3. skips the check if request fails 4. added msw mock so that we don't depend upon it in development and testing * Update app/utils/auth.server.ts Co-authored-by: Kent C. Dodds <[email protected]> * requested changes made 1. Added warning in case if the error is not AbortError to get more info about the error 2. updated the msw mock to follow convention of other msw mocks * renamed the common-password to pwnedpasswords --------- Co-authored-by: Kent C. Dodds <[email protected]>
- Loading branch information
1 parent
468c5e5
commit 832c24c
Showing
5 changed files
with
72 additions
and
4 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
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,7 @@ | ||
import { http, HttpResponse } from 'msw' | ||
|
||
export const handlers = [ | ||
http.get('https://api.pwnedpasswords.com/range/:prefix', () => { | ||
return new HttpResponse('', { status: 200 }) | ||
}), | ||
] |