mirror of https://git.stjo.hn/planiverse
Bump users to the login page
Redirect users to the login page if they try to access a page that requires their account.
This commit is contained in:
parent
87e1fbd3aa
commit
b5f39c096a
|
@ -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)
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue