diff options
author | RaindropsSys <contact@minteck.org> | 2023-05-12 16:43:04 +0200 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-05-12 16:43:04 +0200 |
commit | 0e4f6cea6a4f8d1f860ded405a66f9fca9d93d96 (patch) | |
tree | f8dcad460d9120442e23c8c567ba246eed39f71a /pages/api/reauthenticate.php | |
parent | 761c84c0c17c04113608a20e8401270023741c7e (diff) | |
download | pluralconnect-0e4f6cea6a4f8d1f860ded405a66f9fca9d93d96.tar.gz pluralconnect-0e4f6cea6a4f8d1f860ded405a66f9fca9d93d96.tar.bz2 pluralconnect-0e4f6cea6a4f8d1f860ded405a66f9fca9d93d96.zip |
Updated 5 files and added 29 files (automated)
Diffstat (limited to 'pages/api/reauthenticate.php')
-rw-r--r-- | pages/api/reauthenticate.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/pages/api/reauthenticate.php b/pages/api/reauthenticate.php new file mode 100644 index 0000000..50657cc --- /dev/null +++ b/pages/api/reauthenticate.php @@ -0,0 +1,19 @@ +<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isLowerLoggedIn; + +header("Content-Type: text/plain"); + +if (!$isLoggedIn || $isLowerLoggedIn) { + header("Location: /-/login"); + die(); +} + +$newToken = generateToken(); + +if (isset($_COOKIE['PEH2_SESSION_TOKEN'])) { + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $newToken, file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $_COOKIE['PEH2_SESSION_TOKEN'])); +} + +die($newToken);
\ No newline at end of file |