Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4119e047 authored by Akhil's avatar Akhil 🙂
Browse files

Don't allow requests to image captcha if provider is different

parent 142a0769
Loading
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -275,10 +275,15 @@ class AccountController extends Controller {
	 * @NoCSRFRequired
	 */
	public function captcha(): Http\DataDisplayResponse {
		$captchaValue = $this->captchaService->generateCaptcha();
		// Don't allow requests to image captcha if different provider is set
		if ($this->getCaptchaProvider() !== self::DEFAULT_CAPTCHA_PROVDER) {
			$response = new DataResponse();
			$response->setStatus(400);
			return $response;
		}

		$captchaValue = $this->captchaService->generateCaptcha();
		$response = new Http\DataDisplayResponse($captchaValue, Http::STATUS_OK, ['Content-Type' => 'image/png']);

		return $response;
	}
	/**