diff options
author | Aaron Parecki <aaron@parecki.com> | 2017-01-06 09:09:55 -0800 |
---|---|---|
committer | Aaron Parecki <aaron@parecki.com> | 2017-01-06 09:09:55 -0800 |
commit | 787cb681305d093c471a81ccae1440e3eafd73cb (patch) | |
tree | a901f2afa3c9a0db55fcc60b8349dac3ceaf3b52 /controllers/controllers.php | |
parent | dd2312ddc8654cc35bd9480c06af3cc7d585fdce (diff) |
replace redirects with http 302
Diffstat (limited to 'controllers/controllers.php')
-rw-r--r-- | controllers/controllers.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/controllers/controllers.php b/controllers/controllers.php index 4f150ce..d4f0233 100644 --- a/controllers/controllers.php +++ b/controllers/controllers.php @@ -11,14 +11,14 @@ function require_login(&$app, $redirect=true) { } catch(DomainException $e) { if($redirect) { header('X-Error: DomainException'); - $app->redirect('/', 301); + $app->redirect('/', 302); } else { return false; } } catch(UnexpectedValueException $e) { if($redirect) { header('X-Error: UnexpectedValueException'); - $app->redirect('/', 301); + $app->redirect('/', 302); } else { return false; } @@ -27,7 +27,7 @@ function require_login(&$app, $redirect=true) { if(!array_key_exists('user_id', $_SESSION)) { if($redirect) - $app->redirect('/'); + $app->redirect('/', 302); return false; } else { return ORM::for_table('users')->find_one($_SESSION['user_id']); @@ -225,13 +225,13 @@ $app->get('/add-to-home', function() use($app) { $data = JWT::decode($params['token'], Config::$jwtSecret, array('HS256')); $_SESSION['user_id'] = $data->user_id; $_SESSION['me'] = $data->me; - $app->redirect('/new', 301); + $app->redirect('/new', 302); } catch(DomainException $e) { header('X-Error: DomainException'); - $app->redirect('/', 301); + $app->redirect('/', 302); } catch(UnexpectedValueException $e) { header('X-Error: UnexpectedValueException'); - $app->redirect('/', 301); + $app->redirect('/', 302); } } else { @@ -246,7 +246,7 @@ $app->get('/add-to-home', function() use($app) { 'created_at' => time() ), Config::$jwtSecret); - $app->redirect('/add-to-home?token='.$token, 301); + $app->redirect('/add-to-home?token='.$token, 302); } else { unset($_SESSION['add-to-home-started']); render('add-to-home', array('title' => 'Quill')); |