Skip to content
Snippets Groups Projects
Commit c3e5e4c6 authored by Olimpia Magliulo's avatar Olimpia Magliulo
Browse files

Use queryparams to change language after a login error

Query parameters are passed to the template in order to change language also after an error is shown.
parent 3664e1d9
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,13 @@ if (array_key_exists('password', $_REQUEST)) {
$errorCode = NULL;
$errorParams = NULL;
$queryParams = array();
if (isset($state['error'])) {
$errorCode = $state['error']['code'];
$errorParams = $state['error']['params'];
$queryParams = array('AuthState' => $authStateId);
}
if (!empty($_REQUEST['username']) || !empty($password)) {
// Either username or password set - attempt to log in
......@@ -95,6 +102,9 @@ $t->data['links'] = $source->getLoginLinks();
$t->data['errorcode'] = $errorCode;
$t->data['errorcodes'] = SimpleSAML\Error\ErrorCodes::getAllErrorCodeMessages();
$t->data['errorparams'] = $errorParams;
if (!empty($queryParams)) {
$t->data['queryParams'] = $queryParams;
}
if (isset($state['SPMetadata'])) {
$t->data['SPMetadata'] = $state['SPMetadata'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment