File tree Expand file tree Collapse file tree 3 files changed +44
-0
lines changed
packages/javascript-sdk/src Expand file tree Collapse file tree 3 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ enum CallbackType {
3636 PingOneProtectInitializeCallback = 'PingOneProtectInitializeCallback' ,
3737 PollingWaitCallback = 'PollingWaitCallback' ,
3838 ReCaptchaCallback = 'ReCaptchaCallback' ,
39+ ReCaptchaEnterpriseCallback = 'ReCaptchaEnterpriseCallback ' ,
3940 RedirectCallback = 'RedirectCallback' ,
4041 SelectIdPCallback = 'SelectIdPCallback' ,
4142 StringAttributeInputCallback = 'StringAttributeInputCallback' ,
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import PingOneProtectEvaluationCallback from './ping-protect-evaluation-callback
2424import PingOneProtectInitializeCallback from './ping-protect-initialize-callback' ;
2525import PollingWaitCallback from './polling-wait-callback' ;
2626import ReCaptchaCallback from './recaptcha-callback' ;
27+ import ReCaptchaEnterpriseCallback from './recaptcha-enterprise-callback' ;
2728import RedirectCallback from './redirect-callback' ;
2829import SelectIdPCallback from './select-idp-callback' ;
2930import SuspendedTextOutputCallback from './suspended-text-output-callback' ;
@@ -68,6 +69,8 @@ function createCallback(callback: Callback): FRCallback {
6869 return new PollingWaitCallback ( callback ) ;
6970 case CallbackType . ReCaptchaCallback :
7071 return new ReCaptchaCallback ( callback ) ;
72+ case CallbackType . ReCaptchaEnterpriseCallback :
73+ return new ReCaptchaEnterpriseCallback ( callback ) ;
7174 case CallbackType . RedirectCallback :
7275 return new RedirectCallback ( callback ) ;
7376 case CallbackType . SelectIdPCallback :
Original file line number Diff line number Diff line change 1+ /*
2+ * @forgerock /javascript-sdk
3+ *
4+ * recaptcha-callback.ts
5+ *
6+ * Copyright (c) 2020 ForgeRock. All rights reserved.
7+ * This software may be modified and distributed under the terms
8+ * of the MIT license. See the LICENSE file for details.
9+ */
10+
11+ import FRCallback from '.' ;
12+ import type { Callback } from '../../auth/interfaces' ;
13+
14+ /**
15+ * Represents a callback used to integrate reCAPTCHA.
16+ */
17+ class ReCaptchaEnterpriseCallback extends FRCallback {
18+ /**
19+ * @param payload The raw payload returned by OpenAM
20+ */
21+ constructor ( public payload : Callback ) {
22+ super ( payload ) ;
23+ }
24+
25+ /**
26+ * Gets the reCAPTCHA site key.
27+ */
28+ public getSiteKey ( ) : string {
29+ return this . getOutputByName < string > ( 'recaptchaSiteKey' , '' ) ;
30+ }
31+
32+ /**
33+ * Sets the reCAPTCHA result.
34+ */
35+ public setResult ( result : string ) : void {
36+ this . setInputValue ( result ) ;
37+ }
38+ }
39+
40+ export default ReCaptchaEnterpriseCallback ;
You can’t perform that action at this time.
0 commit comments