Compare commits

..

No commits in common. "cc19d454fa15f6d029ae991d9bab75c3f469f3cc" and "d0751017dbb1a5481e6b79e7aec86d24cbca40ce" have entirely different histories.

3 changed files with 0 additions and 38 deletions

View File

@ -19,7 +19,6 @@ use MapGuesser\Repository\UserRepository;
use MapGuesser\Response\HtmlContent;
use MapGuesser\Response\JsonContent;
use MapGuesser\Response\Redirect;
use MapGuesser\Util\CaptchaValidator;
use MapGuesser\Util\JwtParser;
class LoginController
@ -286,18 +285,6 @@ class LoginController
return new JsonContent($data);
}
if (!empty($_ENV['RECAPTCHA_SITEKEY'])) {
if (!$this->request->post('g-recaptcha-response')) {
return new JsonContent(['error' => ['errorText' => 'Please check "I\'m not a robot" in the reCAPTCHA box!']]);
}
$captchaValidator = new CaptchaValidator();
$captchaResponse = $captchaValidator->validate($this->request->post('g-recaptcha-response'));
if (!$captchaResponse['success']) {
return new JsonContent(['error' => ['errorText' => 'reCAPTCHA challenge failed. Please try again!']]);
}
}
if (filter_var($this->request->post('email'), FILTER_VALIDATE_EMAIL) === false) {
return new JsonContent(['error' => ['errorText' => 'The given email address is not valid.']]);
}
@ -468,18 +455,6 @@ class LoginController
]);
}
if (!empty($_ENV['RECAPTCHA_SITEKEY'])) {
if (!$this->request->post('g-recaptcha-response')) {
return new JsonContent(['error' => ['errorText' => 'Please check "I\'m not a robot" in the reCAPTCHA box!']]);
}
$captchaValidator = new CaptchaValidator();
$captchaResponse = $captchaValidator->validate($this->request->post('g-recaptcha-response'));
if (!$captchaResponse['success']) {
return new JsonContent(['error' => ['errorText' => 'reCAPTCHA challenge failed. Please try again!']]);
}
}
$user = $this->userRepository->getByEmail($this->request->post('email'));
if ($user === null) {

View File

@ -1,5 +1,3 @@
@js(https://www.google.com/recaptcha/api.js)
@extends(templates/layout_normal)
@section(main)
@ -7,11 +5,6 @@
<div class="box">
<form id="passwordResetForm" action="/password/requestReset" method="post" data-redirect-on-success="/password/requestReset/success">
<input type="email" class="text big fullWidth" name="email" placeholder="Email address" value="<?= isset($email) ? $email : '' ?>" required autofocus>
<?php if (!empty($_ENV['RECAPTCHA_SITEKEY'])): ?>
<div class="marginTop">
<div class="g-recaptcha" data-sitekey="<?= $_ENV['RECAPTCHA_SITEKEY'] ?>"></div>
</div>
<?php endif; ?>
<p id="passwordResetFormError" class="formError justify marginTop"></p>
<div class="right marginTop">
<button type="submit">Continue</button>

View File

@ -1,4 +1,3 @@
@js(https://www.google.com/recaptcha/api.js)
@js(js/login/signup.js)
@extends(templates/layout_normal)
@ -16,11 +15,6 @@
<input type="password" class="text big fullWidth marginTop" name="password" placeholder="Password" required minlength="6">
<input type="password" class="text big fullWidth marginTop" name="password_confirm" placeholder="Password confirmation" minlength="6">
<?php endif; ?>
<?php if (!empty($_ENV['RECAPTCHA_SITEKEY'])): ?>
<div class="marginTop">
<div class="g-recaptcha" data-sitekey="<?= $_ENV['RECAPTCHA_SITEKEY'] ?>"></div>
</div>
<?php endif; ?>
<p id="signupFormError" class="formError justify marginTop"></p>
<div class="right">
<button class="marginTop" type="submit">Sign up</button><!--