@@ -88,9 +88,9 @@ export function signUp(id) {
8888 autoLogin : shouldAutoLogin ( m )
8989 } ;
9090
91- const isCaptchaValid = setCaptchaParams ( m , params , Flow . DEFAULT , fields ) ;
91+ const isCaptchaValid = setCaptchaParams ( m , params , Flow . SIGNUP , fields ) ;
9292 if ( ! isCaptchaValid ) {
93- return showMissingCaptcha ( m , id ) ;
93+ return showMissingCaptcha ( m , id , Flow . SIGNUP ) ;
9494 }
9595
9696 if ( databaseConnectionRequiresUsername ( m ) ) {
@@ -131,7 +131,7 @@ export function signUp(id) {
131131
132132 const wasInvalidCaptcha = error && error . code === 'invalid_captcha' ;
133133
134- swapCaptcha ( id , Flow . DEFAULT , wasInvalidCaptcha , ( ) => {
134+ swapCaptcha ( id , Flow . SIGNUP , wasInvalidCaptcha , ( ) => {
135135 setTimeout ( ( ) => signUpError ( id , error ) , 250 ) ;
136136 } ) ;
137137 } ;
@@ -290,7 +290,7 @@ export function resetPasswordSuccess(id) {
290290function resetPasswordError ( id , error ) {
291291 const m = read ( getEntity , 'lock' , id ) ;
292292 let key = error . code ;
293-
293+
294294 if ( error . code === 'invalid_captcha' ) {
295295 const captchaConfig = l . passwordResetCaptcha ( m ) ;
296296 key = (
@@ -302,7 +302,7 @@ function resetPasswordError(id, error) {
302302 const errorMessage =
303303 i18n . html ( m , [ 'error' , 'forgotPassword' , key ] ) ||
304304 i18n . html ( m , [ 'error' , 'forgotPassword' , 'lock.fallback' ] ) ;
305-
305+
306306 swapCaptcha ( id , Flow . PASSWORD_RESET , error . code === 'invalid_captcha' , ( ) => {
307307 swap ( updateEntity , 'lock' , id , l . setSubmitting , false , errorMessage ) ;
308308 } ) ;
@@ -322,11 +322,11 @@ export function showLoginActivity(id, fields = ['password']) {
322322
323323export function showSignUpActivity ( id , fields = [ 'password' ] ) {
324324 const m = read ( getEntity , 'lock' , id ) ;
325- const captchaConfig = l . captcha ( m ) ;
325+ const captchaConfig = l . signupCaptcha ( m ) ;
326326 if ( captchaConfig && captchaConfig . get ( 'provider' ) === 'arkose' ) {
327327 swap ( updateEntity , 'lock' , id , setScreen , 'signUp' , fields ) ;
328328 } else {
329- swapCaptcha ( id , 'login' , false , ( ) => {
329+ swapCaptcha ( id , Flow . SIGNUP , false , ( ) => {
330330 swap ( updateEntity , 'lock' , id , setScreen , 'signUp' , fields ) ;
331331 } ) ;
332332 }
@@ -338,7 +338,7 @@ export function showResetPasswordActivity(id, fields = ['password']) {
338338 if ( captchaConfig && captchaConfig . get ( 'provider' ) === 'arkose' ) {
339339 swap ( updateEntity , 'lock' , id , setScreen , 'forgotPassword' , fields ) ;
340340 } else {
341- swapCaptcha ( id , 'login' , false , ( ) => {
341+ swapCaptcha ( id , Flow . PASSWORD_RESET , false , ( ) => {
342342 swap ( updateEntity , 'lock' , id , setScreen , 'forgotPassword' , fields ) ;
343343 } ) ;
344344 }
0 commit comments