From c69650f82c528181deaaa6f52551fb48b220c51b Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Sun, 7 Jun 2020 21:05:09 -0600 Subject: [PATCH] Fix login URL not working --- api/.htaccess | 2 ++ api/login/index.php | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/api/.htaccess b/api/.htaccess index c26f042..8038dc3 100644 --- a/api/.htaccess +++ b/api/.htaccess @@ -1,4 +1,6 @@ RewriteEngine on + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ([a-zA-Z0-9]+) index.php?action=$1 [PT] \ No newline at end of file diff --git a/api/login/index.php b/api/login/index.php index 9c06bc4..0105673 100644 --- a/api/login/index.php +++ b/api/login/index.php @@ -7,7 +7,6 @@ require __DIR__ . "/../../required.php"; -session_start(); header("Content-Security-Policy: default-src '*';"); header('Access-Control-Allow-Origin: *'); @@ -38,7 +37,7 @@ function showHTML(string $title, string $button = "", string $url = "", string $ - <?php echo $SETTINGS['app_name']; ?> + <?php echo $SETTINGS['site_title']; ?> @@ -109,7 +108,7 @@ if (empty($_SESSION["login_code"])) { $addpassresp = AccountHubApi::get( "addapppassword", [ - "desc" => $SETTINGS["app_name"], + "desc" => $SETTINGS["site_title"], "username" => $user->getUsername() ], true @@ -131,7 +130,7 @@ if (empty($_SESSION["login_code"])) { if ($redirecttologin) { try { - $codedata = AccountHubApi::get("getloginkey", ["appname" => $SETTINGS["app_name"], "appicon" => $iconurl], true); + $codedata = AccountHubApi::get("getloginkey", ["appname" => $SETTINGS["site_title"], "appicon" => $iconurl], true); if ($codedata['status'] != "OK") { throw new Exception("There was a problem. Try again later.");