diff --git a/src/Auth/PIResponse.php b/src/Auth/PIResponse.php index 256edb2..09d5f03 100644 --- a/src/Auth/PIResponse.php +++ b/src/Auth/PIResponse.php @@ -82,7 +82,11 @@ public static function fromJSON(string $json, PrivacyIDEA $privacyIDEA): ?PIResp if (!isset($map['result']['value'])) { $ret->errorCode = $map['result']['error']['code']; - $ret->errorMessage = $map['result']['error']['message']; + $ret->errorMessage = $map['result']['error']['message']; + if ($ret->errorCode == 904){ + $ret->errorCode = 1312; + $ret->errorMessage = 'Sorry, authentication failed... Please try again!'; + } return $ret; } @@ -131,7 +135,9 @@ public static function fromJSON(string $json, PrivacyIDEA $privacyIDEA): ?PIResp } elseif ($r === AuthenticationStatus::REJECT) { - $ret->authenticationStatus = AuthenticationStatus::REJECT; + $ret->authenticationStatus = AuthenticationStatus::REJECT; + $ret->errorCode = 1312; + $ret->errorMessage = 'Sorry, authentication failed... Please try again!'; } else { @@ -420,4 +426,4 @@ public function getErrorMessage(): string { return $this->errorMessage; } -} \ No newline at end of file +} diff --git a/templates/pi-form.twig b/templates/pi-form.twig index 9ccd58d..2b411aa 100644 --- a/templates/pi-form.twig +++ b/templates/pi-form.twig @@ -57,8 +57,13 @@