how can i integrate an captcha in angular , Express

42 Views Asked by At

i tried to use recaptcha it displaying but it's not working properly libraries i tried to use :

  1. primeng captcha : gives me error that primeng doesn't have an captcha component but it's exist in old web site
  2. ngx-recaptcha : i cant integrate it because of version problem and i can't find any answer for it
  3. ng-recaptcha : the one displaying but it just displaying and doesn't works

i can't find any other libraries there are paid somes and manage websites for societies and with big amount i tried to learn about it but as i said that it displaying using recaptcha key.... but there is no validations

here is the send function :

  send(form:any): void {
    if (form.invalid) {
      for (const control of Object.keys(form.controls)) {
        form.controls[control].markAsTouched();
      }
      return ;
    }
    this.recaptchaV3Service.execute('importantAction')
    .subscribe((token: string) => {
      console.debug(`Token [${token}] generated`); 
     console.log(token)
    });
  }

and here is the submit function :

  onSubmit() {
    console.log('--------+++++++', this.creation);

    if (this.creation.invalid) {
      console.log(error);
      
    } else {
      this.helpers.convert(this.creation?.get('petition')?.value, [
        { file: this.selectedPhoto, title: 'photo' },
      ]);
      console.log('Form submitted:', this.creation.value);
    }
  }

when i console the token it gives me a bug hex code what i don't understand

this is the library i'm using right now :

import { RECAPTCHA_V3_SITE_KEY, ReCaptchaV3Service, RecaptchaV3Module } from 'ng-recaptcha';

0

There are 0 best solutions below