PREAUTH_SEND_TO environment variable, to set a default redirection after authenticating
This commit is contained in:
+2
-1
@@ -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'
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user