Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/Auth/PIResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -420,4 +426,4 @@ public function getErrorMessage(): string
{
return $this->errorMessage;
}
}
}
5 changes: 5 additions & 0 deletions templates/pi-form.twig
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,13 @@
<div class="error-dialog">
<img class="float-l erroricon" alt="gtk-dialog-error"
src="{{ baseurlpath }}resources/icons/experience/gtk-dialog-error.48x48.png"/>
{% if errorCode is same as '1312' %}
<h2>{{ 'Authentication failed'|trans }}</h2>
<strong>{{ 'Please try again!'|trans }}</strong>
{% else %}
<h2>{{ 'An error occurred'|trans }}</h2>
<strong>"Error {{ errorCode }}: {{ errorMessage }}"</strong>
{% endif %}
</div>
{% endif %}

Expand Down