This commit is contained in:
@@ -201,10 +201,7 @@ climbingRoutesRouter.post('/', async (req: Request, res: Response) => {
|
|||||||
let captcha_token = req.query['hcaptcha_response'] as string;
|
let captcha_token = req.query['hcaptcha_response'] as string;
|
||||||
|
|
||||||
if (isNaN(gym_id) || !name || !difficulty || !captcha_token) {
|
if (isNaN(gym_id) || !name || !difficulty || !captcha_token) {
|
||||||
res.status(400).send({
|
res.status(400).send({'message': 'Missing parameters'});
|
||||||
'message': 'Missing parameters',
|
|
||||||
'query_params': req.query
|
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import * as dotenv from 'dotenv';
|
import * as dotenv from 'dotenv';
|
||||||
import * as querystring from 'querystring';
|
import * as querystring from 'qs';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
dotenv.config();
|
dotenv.config();
|
||||||
|
|
||||||
export const verifyCaptcha = async (captcha_token: string): Promise<boolean> => {
|
export const verifyCaptcha = async (captcha_token: string): Promise<boolean> => {
|
||||||
var postData = querystring.stringify({
|
let postData = querystring.stringify({
|
||||||
response: captcha_token,
|
response: captcha_token,
|
||||||
secret: process.env.HCAPTCHA_SECRET
|
secret: process.env.HCAPTCHA_SECRET
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user