From b6c6c85bb702861458e4de9aed388485477f4166 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 8 Mar 2022 22:22:40 -0700 Subject: [PATCH 1/2] Update SpaController, handle web redirects --- app/Http/Controllers/SpaController.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/SpaController.php b/app/Http/Controllers/SpaController.php index a64a880b5..76bfacc43 100644 --- a/app/Http/Controllers/SpaController.php +++ b/app/Http/Controllers/SpaController.php @@ -27,10 +27,6 @@ class SpaController extends Controller return view('layouts.spa'); } - if(SnowflakeService::byDate(now()->subDays(30)) > $id) { - return redirect('/login'); - } - $post = StatusService::get($id); if( @@ -39,6 +35,7 @@ class SpaController extends Controller isset($post['local']) && $post['local'] === true ) { + sleep(5); return redirect($post['url']); } @@ -56,11 +53,13 @@ class SpaController extends Controller return view('layouts.spa'); } - // $account = AccountService::get($id); + $account = AccountService::get($id); - // if($account && isset($account['url'])) { - // return redirect($account['url']); - // } + sleep(5); + + if($account && isset($account['url']) && $account['local']) { + return redirect($account['url']); + } return redirect('/login'); } From 1e1d4621ac2192cf761f39ca20184f5c936df100 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 8 Mar 2022 22:23:10 -0700 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfef31bee..4321e8825 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -74,6 +74,7 @@ - Updated AP Helpers, fixes #3290. ([53975206](https://github.com/pixelfed/pixelfed/commit/53975206)) - Updated AccountController, refresh relationship after handling follow request. ([fe768785](https://github.com/pixelfed/pixelfed/commit/fe768785)) - Updated CollectionController, fixes #3289. ([c7e1e473](https://github.com/pixelfed/pixelfed/commit/c7e1e473)) +- Updated SpaController, handle web redirects. ([b6c6c85b](https://github.com/pixelfed/pixelfed/commit/b6c6c85b)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.2 (2022-01-09)](https://github.com/pixelfed/pixelfed/compare/v0.11.1...v0.11.2)