auth api
This commit is contained in:
parent
383473e4bc
commit
b27b98fe3f
2 changed files with 14 additions and 2 deletions
5
docs/auth.php
Normal file
5
docs/auth.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
require("../libs/auth.php");
|
||||
global $username;
|
||||
echo $username;
|
||||
?>
|
|
@ -31,6 +31,13 @@
|
|||
|
||||
setcookie("token", $token, time()+3600*24);
|
||||
|
||||
if (isset($_GET['next'])) {
|
||||
$gett = htmlspecialchars($_GET['next'] . '?token=' . $token);
|
||||
echo "<script>window.location.href = '$gett'</script>";
|
||||
page_footer();
|
||||
die();
|
||||
}
|
||||
|
||||
header("Location: /");
|
||||
die();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue