-
Notifications
You must be signed in to change notification settings - Fork 556
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IAMRISK-3539] Use signup captcha enforcement endpoint for signup flow
- Loading branch information
Showing
13 changed files
with
97 additions
and
34 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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 |
---|---|---|
|
@@ -33,7 +33,7 @@ describe('captcha on signup', function () { | |
describe('svg-captcha', () => { | ||
describe('when the api returns a new challenge', function () { | ||
beforeEach(function (done) { | ||
this.stub = h.stubGetChallenge([svgCaptchaRequiredResponse1, svgCaptchaRequiredResponse2]); | ||
this.stub = h.stubGetSignupChallenge([svgCaptchaRequiredResponse1, svgCaptchaRequiredResponse2]); | ||
this.lock = h.displayLock('', lockOpts, done); | ||
}); | ||
|
||
|
@@ -88,7 +88,7 @@ describe('captcha on signup', function () { | |
|
||
describe('when the challenge api returns required: false', function () { | ||
beforeEach(function (done) { | ||
h.stubGetChallenge({ | ||
h.stubGetSignupChallenge({ | ||
required: false | ||
}); | ||
this.lock = h.displayLock('', lockOpts, done); | ||
|
@@ -110,7 +110,7 @@ describe('captcha on signup', function () { | |
}); | ||
|
||
h.waitForEmailAndPasswordInput(this.lock, () => { | ||
h.stubGetChallenge(svgCaptchaRequiredResponse1); | ||
h.stubGetSignupChallenge(svgCaptchaRequiredResponse1); | ||
h.fillEmailInput(this.lock, '[email protected]'); | ||
h.fillComplexPassword(this.lock); | ||
h.submitForm(this.lock); | ||
|
@@ -127,7 +127,7 @@ describe('captcha on signup', function () { | |
describe('recaptcha', () => { | ||
describe('when the api returns a new challenge', function () { | ||
beforeEach(function (done) { | ||
this.stub = h.stubGetChallenge([recaptchav2Response]); | ||
this.stub = h.stubGetSignupChallenge([recaptchav2Response]); | ||
this.lock = h.displayLock('', lockOpts, done); | ||
}); | ||
|
||
|
@@ -157,10 +157,12 @@ describe('captcha on signup', function () { | |
|
||
describe('when the challenge api returns required: false', function () { | ||
let notRequiredStub; | ||
let loginGetChallengeStub; | ||
beforeEach(function (done) { | ||
notRequiredStub = h.stubGetChallenge({ | ||
notRequiredStub = h.stubGetSignupChallenge({ | ||
required: false | ||
}); | ||
loginGetChallengeStub = h.stubGetChallenge([recaptchav2Response]); | ||
this.lock = h.displayLock('', lockOpts, done); | ||
}); | ||
|
||
|
@@ -169,6 +171,7 @@ describe('captcha on signup', function () { | |
}); | ||
|
||
it('should not show the captcha input', function () { | ||
expect(loginGetChallengeStub.calledOnce).to.be.false; | ||
expect(h.q(this.lock, '.auth0-lock-recaptchav2')).to.not.be.ok(); | ||
}); | ||
|
||
|
@@ -181,7 +184,7 @@ describe('captcha on signup', function () { | |
setTimeout(done, 260); | ||
}); | ||
|
||
challengeStub = h.stubGetChallenge(recaptchav2Response); | ||
challengeStub = h.stubGetSignupChallenge([recaptchav2Response]); | ||
h.fillEmailInput(this.lock, '[email protected]'); | ||
h.fillComplexPassword(this.lock); | ||
h.submitForm(this.lock); | ||
|
@@ -190,6 +193,7 @@ describe('captcha on signup', function () { | |
it('should call the challenge api again and show the input', function () { | ||
expect(notRequiredStub.calledOnce).to.be.true; | ||
expect(challengeStub.calledOnce).to.be.true; | ||
expect(loginGetChallengeStub.calledOnce).to.be.false; | ||
expect(h.q(this.lock, '.auth0-lock-recaptchav2')).to.be.ok(); | ||
}); | ||
}); | ||
|
Oops, something went wrong.