Nextjs 13 ReCAPTCHA

Поделиться
HTML-код
  • Опубликовано: 7 фев 2025
  • Packages used:
    www.npmjs.com/...
    www.npmjs.com/...
    Get keys from ReCAPTCHA:
    www.google.com...
    To learn more about server & client components:
    • Next.js 13 Update | Ep...
    Need a website? Check us out: fabled-web.ca

Комментарии • 21

  • @arctic_frost1
    @arctic_frost1 Год назад +3

    I'd love to see the server side part of this video! Nice work

  • @shahzadasalman8461
    @shahzadasalman8461 Год назад +1

    Thank you for this tutorial. you deserve more views and subscribers

  • @DankAlighieri
    @DankAlighieri 7 месяцев назад

    Thank you! Helped me out a lot! Cheers from Brazil!

    • @benhaig
      @benhaig  7 месяцев назад

      Very glad you found the content helpful 😁

  • @SebastianPiñango-x2b
    @SebastianPiñango-x2b 3 месяца назад

    Very good tutorial!!

  • @FeiyangCoco
    @FeiyangCoco Год назад +1

    The only working tutorial

  • @DeathTheKidBeats
    @DeathTheKidBeats 5 месяцев назад

    Better help than Chatgpt!!

  • @bricecalice2079
    @bricecalice2079 11 месяцев назад

    Thank you.

  • @craashu
    @craashu Год назад

    Nice, that's exactly what I am needing right now. Would be also nice to see how to verify this on the server side, maybe with express? :)

    • @benhaig
      @benhaig  Год назад

      Most likely will do a video on that. Also with different serverless environments😁

  • @bizmich_
    @bizmich_ Год назад

    thank you

  • @hikmetcan5205
    @hikmetcan5205 6 месяцев назад

    Can this package be used for v3 as well?

  • @gauravmisal4610
    @gauravmisal4610 Год назад

    hey ben , after some time the recaptcha gets expired and I'm unable to reset it after submit how can I reset it

  • @glebpolyakov6901
    @glebpolyakov6901 Год назад

    nice video , sonks

  • @JamesWood-u1v
    @JamesWood-u1v Год назад

    Nice video but would have been even better if it covered the server side

  • @mogo6798
    @mogo6798 Год назад

    So is this enough for a normal contact form?
    Btw Thanks for the great tutorial.

    • @benhaig
      @benhaig  Год назад +1

      For a simple contact yeah, you can handle it all client side. Keep in mind though without server verification it can receive malicious requests if someone with technical know-how wants to hurt you/your site.
      For a basic site, you will be fine.

    • @mogo6798
      @mogo6798 Год назад

      @@benhaig I implemented a function using next js server action to verify the captcha. can you tell me this function is correct or not?
      export async function verifyCaptchaAction(token: string | null) {
      try {
      const secretKey = process.env.RECAPTCHA_SECRET_KEY;
      const response = await fetch(
      `www.google.com/recaptcha/api/siteverify?secret=${secretKey}&response=${token}`,
      {
      method: 'POST',
      }
      );
      if (response.ok) {
      return true;
      } else {
      throw new Error("reCAPTCHA response failed");
      }
      } catch (error) {
      throw new Error(`An error occurred during reCAPTCHA verification: ${error}`);
      }
      }

  • @aymenbachiri-yh2hd
    @aymenbachiri-yh2hd 9 месяцев назад

    Thank You

  • @PeriklesPeriklesoglu
    @PeriklesPeriklesoglu 4 месяца назад

    thank you