Closed harora-ot closed 5 years ago
This is supported in the Angular Captcha Module since v3.6.0. After you import Angular Captcha Module in your app.module.ts:
// import the Angular Captcha Module
import { BotDetectCaptchaModule } from 'angular-captcha';
@NgModule({
imports: [
...
BotDetectCaptchaModule
],
...
})
set the captchaEndpoint in your component:
import { CaptchaComponent } from 'angular-captcha';
export class YourFormWithCaptchaComponent {
ngOnInit(): void {
this.captchaComponent.captchaEndpoint =
// if you have asp.net on backend
'https://your-app-backend-hostname.your-domain.com/simple-captcha-endpoint.ashx';
// if you have java on backend
// 'https://your-app-backend-hostname.your-domain.com/simple-captcha-endpoint';
// if you have php on backend
//'https://your-app-backend-hostname.your-domain.com/botdetect-captcha-lib/simple-botdetect.php';
}
Run the following command to get the latest version:
npm i angular-captcha@latest
Thanks for reporting the issue! If you have any further questions, please feel free to contact us at: https://captcha.com/contact.html
The current way of initializing the module requires the config to be specified while loading the module. We have a requirement where the endpoint is not known until needed. But there is no way to re-configure the config, as the component fires the request from
onInit()
itself.