Skip to content
Snippets Groups Projects
Commit 25229c27 authored by Dominik František Bučík's avatar Dominik František Bučík
Browse files

chore: merge branch 'forward_reset_url' into 'main'

feat: :guitar: Forward URLs to get back to login after registration

See merge request perun-proxy-aai/simplesamlphp/simplesamlphp-module-lsaai!8
parents 015e730e 512dfe37
No related branches found
No related tags found
1 merge request!8feat: 🎸 Forward URLs to get back to login after registration
Pipeline #296750 passed with warnings
......@@ -7,8 +7,13 @@ use SimpleSAML\Module\lsaai\TemplateHelper;
const REGISTER_LINK = 'register_link';
$backlink = (empty($_SERVER['HTTPS']) ? 'http' : 'https') . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$conf = Configuration::getConfig(TemplateHelper::CONFIG_FILE_NAME);
$register_link = $conf->getString(REGISTER_LINK);
parse_str(parse_url($register_link, PHP_URL_QUERY), $query_params);
$query_params['targetnew'] = $query_params['targetexisting'] = $query_params['targetextended'] = $backlink;
$register_link = strtok($register_link, '?') . '?' . http_build_query($query_params);
if (strlen($this->data['username']) > 0) {
$this->data['autofocus'] = 'password';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment