-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: integrate captcha for auth resolver
- Loading branch information
1 parent
711632a
commit db49ad9
Showing
5 changed files
with
55 additions
and
70 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 |
---|---|---|
|
@@ -12,33 +12,28 @@ test('can validate', t => { | |
t.throws(() => validators.assertValidPassword('')); | ||
t.throws(() => validators.assertValidPassword('aaaaaaaaaaaaaaaaaaaaa')); | ||
|
||
// verify with captcha | ||
t.notThrows(() => | ||
validators.assertValidCredential({ | ||
email: '[email protected]', | ||
password: 'password', | ||
token: 'captchaToken', | ||
}) | ||
); | ||
// verify with challenge | ||
t.notThrows(() => | ||
validators.assertValidCredential({ | ||
email: '[email protected]', | ||
password: 'password', | ||
token: 'verifyToken', | ||
challenge: 'challenge', | ||
}) | ||
); | ||
t.notThrows(() => | ||
validators.assertValidCredential({ | ||
email: '[email protected]', | ||
password: 'password', | ||
verifyToken: 'verifyToken', | ||
}) | ||
); | ||
// challenge and verifyToken should not be both provided | ||
t.throws(() => | ||
validators.assertValidCredential({ | ||
email: '[email protected]', | ||
password: 'password', | ||
challenge: 'challenge', | ||
verifyToken: 'verifyToken', | ||
}) | ||
); | ||
}); |
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