PREAUTH_SEND_TO environment variable, to set a default redirection after authenticating

This commit is contained in:
2025-11-12 16:17:04 -05:00
parent 25186c3aa9
commit e27d393165
2 changed files with 4 additions and 1 deletions
+2 -1
View File
@@ -4,10 +4,11 @@ PREAUTH_KEY=''
# TOTP (RFC 6238) secret/token (static random bytes) in base32
PREAUTH_TOKEN=''
# optional, change time-to-live, subdomain, text or colors
# optional, change time-to-live, subdomain, default-redirect, text or colors
# how long a session lasts (in minutes): 43200 is 30 days
PREAUTH_TTL=43200
PREAUTH_SUBDOMAIN='preauth'
PREAUTH_SEND_TO='https://secure.example.com/'
PREAUTH_BACKGROUND='#029386'
PREAUTH_FOREGROUND='#ffffff'
PREAUTH_TITLE='Pre-Authentication System'
+2
View File
@@ -107,6 +107,8 @@ class Auth {
if ($this->login()) {
if (isset($this->get['rt'])) {
header("Location: {$this->get['rt']}");
} else if (getenv('PREAUTH_SEND_TO')) {
header("Location: " . getenv('PREAUTH_SEND_TO'));
}
echo "ok $this->id";
return;