mirror of https://github.com/MISP/MISP
Merge pull request #8217 from DCSO/linotp_errormessages
[chg] LinOTP error exceptions up to the uipull/8227/head
commit
78d6f8b93f
|
@ -138,7 +138,7 @@ class LinOTPAuthenticate extends BaseAuthenticate
|
|||
if (!$linOTP_baseUrl || $linOTP_baseUrl === "") {
|
||||
CakeLog::error("LinOTP: Please configure baseUrl.");
|
||||
if ($mixedauth) {
|
||||
throw new CakeException(__d('cake_dev', 'LinOTP: Missing "baseUrl" configuration - access denied!', 'authenticate()'));
|
||||
throw new ForbiddenException(__('LinOTP: Missing "baseUrl" configuration - access denied!'));
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ class LinOTPAuthenticate extends BaseAuthenticate
|
|||
} else {
|
||||
// Enforce OTP token by Authentication Form
|
||||
if (!$otp || $otp === "") {
|
||||
throw new CakeException(__d('cake_dev', 'Missing OTP Token.', 'authenticate()'));
|
||||
throw new ForbiddenException(__('Missing OTP Token.'));
|
||||
}
|
||||
|
||||
$response = $this->_linotp_verify(
|
||||
|
@ -207,7 +207,7 @@ class LinOTPAuthenticate extends BaseAuthenticate
|
|||
// Don't fall back to FormAuthenticate in mixedauth mode.
|
||||
// This enforces the second factor.
|
||||
if ($mixedauth && !self::$user) {
|
||||
throw new CakeException(__d('cake_dev', 'User could not be authenticated by LinOTP.', 'authenticate()'));
|
||||
throw new UnauthorizedException(__('User could not be authenticated by LinOTP.'));
|
||||
}
|
||||
return self::$user;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue