planiverse

A minimalist, no-JS front-end for Mastodon.
git clone https://git.mulligrubs.me/planiverse
Log | Files | Refs | README | LICENSE

commit d139be438788f890e50d4fa46201c978d0232310
parent d861c926cd284d9ba709e3483c5ab48b3a044204
Author: St John Karp <contact@stjo.hn>
Date:   Sun, 12 Aug 2018 07:40:07 -0700

Bump users to the login page

Redirect users to the login page if they try to access a page
that requires their account.

Diffstat:
Mapp/Http/Controllers/TimelineController.php | 5+++++
Mroutes/web.php | 3++-
2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/app/Http/Controllers/TimelineController.php b/app/Http/Controllers/TimelineController.php @@ -17,6 +17,11 @@ class TimelineController extends Controller public function home_timeline() { + if (!session()->has('user')) + { + return redirect()->route('login'); + } + $user = session('user'); $timeline = Mastodon::domain(env('MASTODON_DOMAIN')) ->token($user->token) diff --git a/routes/web.php b/routes/web.php @@ -21,6 +21,7 @@ Route::get('/timeline/public', 'TimelineController@public_timeline') Route::get('/timeline/friends', 'TimelineController@home_timeline') ->name('friends'); -Route::get('/login', 'LoginController@login'); +Route::get('/login', 'LoginController@login') + ->name('login'); Route::get('/callback', 'LoginController@callback');