All Projects → lookinlab → adonis-recaptcha2

lookinlab / adonis-recaptcha2

Licence: MIT License
Google reCAPTCHA for AdonisJS

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to adonis-recaptcha2

recaptcha2
Easy verifier for google reCAPTCHA version 2 for Node.js and Express.js
Stars: ✭ 48 (+100%)
Mutual labels:  captcha, google-recaptcha
Codeigniter-recaptcha
CodeIgniter library to use Google's reCAPTCHA V2
Stars: ✭ 25 (+4.17%)
Mutual labels:  google-recaptcha
captcha-ios
iOS Captcha Solver
Stars: ✭ 33 (+37.5%)
Mutual labels:  captcha
captcha-breaking-library
Neural network, contour analysis, bitmap vector subtraction CAPTCHA solving library and scripting language with perceptive color space segmentation
Stars: ✭ 76 (+216.67%)
Mutual labels:  captcha
opensea automatic uploader
(Bypass reCAPTCHAs) A Selenium Python bot to automatically and bulky upload and list your NFTs on OpenSea (all metadata integrated - Ethereum and Polygon supported); reCAPTCHA solver & bypasser included.
Stars: ✭ 205 (+754.17%)
Mutual labels:  captcha
adonis-modules
📦 Discover all AdonisJS packages developed by the community
Stars: ✭ 23 (-4.17%)
Mutual labels:  adonisjs
adonisjs-electron
Boilerplate for adonisjs + Electron
Stars: ✭ 17 (-29.17%)
Mutual labels:  adonisjs
phone-captcha
📱 Block robocalls with captcha for phone calls
Stars: ✭ 32 (+33.33%)
Mutual labels:  captcha
manager
The builder (Manager) pattern implementation used by AdonisJs
Stars: ✭ 14 (-41.67%)
Mutual labels:  adonisjs
2captcha-go
Golang Module for easy integration with the API of 2captcha captcha solving service to bypass recaptcha, hcaptcha, funcaptcha, geetest and solve any other captchas.
Stars: ✭ 31 (+29.17%)
Mutual labels:  captcha
eros-plugin-ios-TencentCaptcha
腾讯防水墙、滑动验证、类似bilibili滑动验证码
Stars: ✭ 21 (-12.5%)
Mutual labels:  captcha
django-rest-captcha
No description or website provided.
Stars: ✭ 25 (+4.17%)
Mutual labels:  captcha
go-captcha
Go Captcha is a behavioral captcha, which implements the generation of random verification text and the verification of click position information.
Stars: ✭ 86 (+258.33%)
Mutual labels:  captcha
recaptcha
Google reCAPTCHA v2 PHP class
Stars: ✭ 41 (+70.83%)
Mutual labels:  google-recaptcha
hcaptcha-bundle
A Symfony 4+ bundle to bring hCaptcha into your forms
Stars: ✭ 15 (-37.5%)
Mutual labels:  captcha
captcha-generator
An NPM package to generate captcha images that can be used in Discord bots or various other projects
Stars: ✭ 45 (+87.5%)
Mutual labels:  captcha
imagetyperz-api-python3
imagetyperz-api-python3 - is a super easy to use bypass captcha API wrapper for imagetyperz.com captcha service
Stars: ✭ 25 (+4.17%)
Mutual labels:  captcha
Z-Spider
一些爬虫开发的技巧和案例
Stars: ✭ 33 (+37.5%)
Mutual labels:  captcha
League-of-Legends-Accounts-Creator
Accounts Creator for League of Legends.
Stars: ✭ 46 (+91.67%)
Mutual labels:  captcha
adonis-graphql-server
A GraphQL server built with Apollo server and AdonisJs
Stars: ✭ 31 (+29.17%)
Mutual labels:  adonisjs

Adonis ReCAPTCHA v2

npm-image license-image typescript-image

Verifier for Google ReCAPTCHA v2. Not working with ReCAPTCHA Enterprise or v3

Docs for Adonis v4

Installation

Make sure to install it using npm or yarn.

# npm
npm i adonis-recaptcha2
node ace configure adonis-recaptcha2

# yarn
yarn add adonis-recaptcha2
node ace configure adonis-recaptcha2

How to use

Step 1: Get secret and site keys

You need to receive your siteKey and secretKey for your domain from Google reCAPTCHA v3 Admin Console

Login and Follow the steps on this page to include the reCAPTCHA on your website.

Step 2: Initialization

  • Make sure to register the provider inside .adonisrc.json file.
{
  "providers": [
    "...other packages",
    "adonis-recaptcha2"
  ] 
}
  • Add variables to .env file of project.
...
RECAPTCHA_SITE_KEY=YOUR_KEY
RECAPTCHA_SECRET_KEY=YOUR_KEY
  • Add fields to env.ts file of project.
import Env from '@ioc:Adonis/Core/Env'

export default Env.rules({
  // ...
  RECAPTCHA_SITE_KEY: Env.schema.string(),
  RECAPTCHA_SECRET_KEY: Env.schema.string(),
})
  • Set options in config/recaptcha.ts.
import Env from '@ioc:Adonis/Core/Env'
import { RecaptchaConfig } from '@ioc:Adonis/Addons/Recaptcha2'

const recaptchaConfig: RecaptchaConfig = {
  // ...
  siteKey: Env.get('RECAPTCHA_SITE_KEY'),
  // ...
  secretKey: Env.get('RECAPTCHA_SECRET_KEY'),
}
export default recaptchaConfig

Step 3: Add named middleware to start/kernel.ts

Server.middleware.registerNamed({
  recaptcha: () => import('App/Middleware/Recaptcha')
})

Step 4: Add middleware for start/routes.ts

Example:

Route.post('login', 'AuthController.login').middleware('recaptcha')

This middleware will check g-recaptcha-response field in body request

{
  "login": "admin",
  "password": "admin",
  "g-recaptcha-response": "osjoiadjaoisdjasijda..."
}

Field g-recaptcha-response it is Google reCAPTCHA v2 response

Use in Views

Note: Required View (@adonisjs/view)

Step 1: Enable views in config/recaptcha.ts

const recaptchaConfig: RecaptchaConfig = {
  // ... 
  views: true
}

Step 2: Use recaptcha() function in templates

...
<head>
  ...
  {{ recaptcha('script') }}
</head>
<body>
  <section>
    ...
    <form action="/login">
      ...
      {{ recaptcha('form') }}
    </form>
  </section>
</body>
</html>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].