Git Product home page Git Product logo

angular-captcha's Introduction

angular-captcha's People

Contributors

botdetect-support avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

angular-captcha's Issues

captchaId is undefined

Hi, I am using angular-captcha version 3.7.4 with Java Spring

I have got this error in Captcha Validation

core.js:6456 ERROR TypeError: Cannot read properties of undefined (reading 'value') at CaptchaComponent.get [as captchaCode] (captcha.component.js:35:1) at CaptchaComponent.get [as userEnteredCaptchaCode] (captcha.component.js:42:1) at ForgetPasswordComponent.validate (forget-password.component.ts:27:55) at ForgetPasswordComponent_Template_button_click_17_listener (forget-password.component.html:33:64) at executeListenerWithErrorHandling (core.js:15281:1) at wrapListenerIn_markDirtyAndPreventDefault (core.js:15319:1) at HTMLButtonElement.<anonymous> (platform-browser.js:560:1) at ZoneDelegate.invokeTask (zone.js:406:1) at Object.onInvokeTask (core.js:28654:1) at ZoneDelegate.invokeTask (zone.js:405:1)

it seems like captchaId is undefined

my code look like this in forget-password.component.ts

` validate(value, valid): void {
let userEnteredCaptchaCode = this.captchaComponent.userEnteredCaptchaCode;
let captchaId = this.captchaComponent.captchaId;

const postData = {
  userEnteredCaptchaCode: userEnteredCaptchaCode,
  captchaId: captchaId
};

// post the captcha data to the backend
this.dataService.postAPI(`${this.baseUrl}/botdetectcaptcha`, postData).subscribe(
  response => {
    if (response.success == false) {
      // captcha validation failed; reload image
      this.captchaComponent.reloadImage();
      // TODO: maybe display an error message, too
    } else {
      // TODO: captcha validation succeeded; proceed with the workflow
    }
  }
)

}`

The requested captchaStyle 'yourFirstCaptchaStyle' is not defined in the botdetect.xml!

Hey, I use angular-captcha with angular frontend and spring backend.
I did all the steps defined in https://captcha.com/angular-captcha.html#angular-java-spring-backend:springboot-autoconfiguration but when I call my-api-endpoint/simple-captcha-endpoint?get=html&c=yourFirstCaptchaStyle its gives me the followeing error

{ "timestamp": "2021-02-08T00:37:14.011+0000", "status": 400, "error": "Bad Request", "message": "The requested captchaStyle 'yourFirstCaptchaStyle' is not defined in the botdetect.xml!", "path": "//simple-captcha-endpoint" }

here is my botdetect.xml file content :
<?xml version="1." encodi0ng="UTF-8"?>
<botdetect xmlns="https://captcha.com/schema/java" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://captcha.com/schema/java https://captcha.com/schema/java/botdetect-4.0.beta3.7.xsd"> <captchaStyles> <captchaStyle> <name>yourFirstCaptchaStyle</name> <userInputID>yourFirstCaptchaUserInput</userInputID> </captchaStyle> </captchaStyles> </botdetect>

did I miss something ? thanks in advance

captcha not found

hi
i'm using your angular package on my project.
my backend project is a web api core on .net core 2.2.
when i debug the project localy everything work fine, but when i deploy to iis(8.5,10) i get this error :

Untitled

here is my api configuration in startup.cs :

app.MapWhen(context => { Console.WriteLine(context.Request.Path); return context.Request.Path.ToString().EndsWith(".ashx"); }, appBuilder => { appBuilder.UseSimpleCaptcha(Configuration.GetSection("BotDetect")); } );

i went over your documentation a few times but found nothing related to this problem in .net core.

can't use the angular-captcha component inside e2e tests with protractor

Hello, we tried to use this angular module with BotDetect captcha, but there's some problem where the test hangs and doesn't continue once we land on the captcha page.

It looks like the captcha is blocking the progress of the tests.

Notice that when we set browser.waitForAngularEnabled(false) before the test, the test continues to run past the step where it got stuck, but as soon as I run browser.waitForAngularEnabled(true) the e2e is stuck again.

Is there a way to use this in e2e tests? If not, unfortunately, we'll have to change to a different captcha library.

Generic type 'ModuleWithProviders<T>' requires 1 type argument(s) error with Typescript 5.0+ and Angular 16+

I updated my projects to use Angular 16.1.4 with Typescript 5.1.6.
Now I get these build errors:

Error: node_modules/angular-captcha/src/botdetect-captcha.module.d.ts:4:46 - error TS2314: Generic type 'ModuleWithProviders' requires 1 type argument(s).

Error: projects/shared-portals/src/lib/shared-portals.module.ts:66:9 - error NG6002: 'BotDetectCaptchaModule' does not appear to be an NgModule class.

66 BotDetectCaptchaModule,
~~~~~~~~~~~~~~~~~~~~~~

node_modules/angular-captcha/src/botdetect-captcha.module.d.ts:3:22
3 export declare class BotDetectCaptchaModule {
~~~~~~~~~~~~~~~~~~~~~~
This likely means that the library (angular-captcha) which declares BotDetectCaptchaModule is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

Am I missing something, or is angular-captcha unable to support Angular 16 + Typescript 5?

Can't resolve all parameters for CaptchaService: (?, ?, ?)

I have followed the steps in npm for setting up this package but after adding this code:

BotDetectCaptchaModule.forRoot({
      captchaEndpoint: '/botdetect-java-captcha-api-path-at-server-side/botdetectcaptcha'
    })

to my appModule, the app log the following error in console:

compiler.js:466 Uncaught Error: Can't resolve all parameters for CaptchaService: (?, ?, ?).
    at syntaxError (compiler.js:466)
    at CompileMetadataResolver._getDependenciesMetadata (compiler.js:15547)
    at CompileMetadataResolver._getTypeMetadata (compiler.js:15382)
    at CompileMetadataResolver._getInjectableMetadata (compiler.js:15362)
    at CompileMetadataResolver.getProviderMetadata (compiler.js:15722)
    at eval (compiler.js:15633)
    at Array.forEach (<anonymous>)
    at CompileMetadataResolver._getProvidersMetadata (compiler.js:15593)
    at eval (compiler.js:15595)
    at Array.forEach (<anonymous>)

I don't use systemJS so I skip the systemJS step in npm

Not working with Angular 8

The error:
Uncaught Error: Can't resolve all parameters for CorrectCaptchaDirective: (?, [object Object])...

It seams that the import:
import { DOCUMENT } from '@angular/platform-browser';

has changed to:
import { DOCUMENT } from '@angular/common';

problem with angular 16+

hi,
when we started using BotDetectCaptcha in angular 16+ projectes we encountered this error, would you please consider this issue:

This likely means that the library (angular-captcha) which declares BotDetectCaptchaModule is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.