Update SpaController, redirect web ui hashtags to legacy page for unauthenticated users

This commit is contained in:
Daniel Supernault 2022-03-03 20:51:13 -07:00
parent 7dc65456c7
commit a44b812b13
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
2 changed files with 10 additions and 0 deletions

View file

@ -126,4 +126,13 @@ class SpaController extends Controller
}
return redirect('/i/web/profile/' . $id);
}
public function hashtagRedirect(Request $request, $tag)
{
if(!$request->user()) {
return redirect('/discover/tags/' . $tag);
}
return view('layouts.spa');
}
}

View file

@ -351,6 +351,7 @@ Route::domain(config('pixelfed.domain.app'))->middleware(['validemail', 'twofact
Route::post('warning', 'AccountInterstitialController@read');
Route::get('my2020', 'SeasonalController@yearInReview');
Route::get('web/hashtag/{tag}', 'SpaController@hashtagRedirect');
Route::get('web/username/{id}', 'SpaController@usernameRedirect');
Route::get('web/post/{id}', 'SpaController@webPost');
Route::get('web/profile/{id}', 'SpaController@webProfile');