Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

promise-geetest

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

promise-geetest

geetest ad promise wapper

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
increased by1200%
Maintainers
1
Weekly downloads
 
Created
Source

base on geetest


useage

npm i geetest promise-geetest --save


const privateKey = 'privateKey'
const publicKey = 'publicKey'
const Geetest = require('promise-geetest')
const geetest = new Geetest(privateKey, publicKey)

router.get('/register', async (ctx) => {
    // 向极验申请一次验证所需的challenge
    const data = await geetest.register().catch(err => null)
    if (data)
        ctx.body = data
    else
        ctx.body = 'error'
})

router.post('/validate', async (ctx) => {
    const {
        geetest_challenge: challenge,
        geetest_validate: validate,
        geetest_seccode: seccode
    } = ctx.request.body
    // 对ajax提交的验证结果值进行验证
    const result = await geetest.validate({ challenge, validate, seccode }).catch(err => null)
    if (result)
        ctx.body = JSON.stringify(result)
    else
        ctx.body = 'error'
})

Keywords

FAQs

Package last updated on 21 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc