Last adjustments for the gym_id problem on backend side
All checks were successful
Jenkins Production Deployment

This commit is contained in:
Patrick Müller 2022-01-11 18:03:47 +01:00
parent c84cbd240d
commit 924d16a1a4
Signed by: Paddy
GPG Key ID: 37ABC11275CAABCE
2 changed files with 3 additions and 6 deletions

View File

@ -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;
} }

View File

@ -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
}); });