Skip to content

Latest commit

 

History

History
33 lines (21 loc) · 468 Bytes

README.md

File metadata and controls

33 lines (21 loc) · 468 Bytes

jwt-recaptcha

using jwt for recaptcha in php

Server generate hash

$secret;

$re = new ReCaptcha($secret);
$hash = $re->hash();

echo $hash["token"]; //token sent to user, use for verify later
echo $hash["image"]; //recaptcha image

Server verify recaptcha code

$re = new ReCaptcha($secret);
$code;//get from user
$token;//get from user sent before

if($re->verify($code,$token)){
    //correct code
}else{
    //incorrect code 
}