forked from mirror/pixelfed
Update ProfileController, redirect profile view for authed users to Metro 2.0 UI
This commit is contained in:
parent
71dff472cc
commit
7f8129a75c
1 changed files with 11 additions and 0 deletions
|
@ -26,6 +26,17 @@ class ProfileController extends Controller
|
||||||
{
|
{
|
||||||
public function show(Request $request, $username)
|
public function show(Request $request, $username)
|
||||||
{
|
{
|
||||||
|
// redirect authed users to Metro 2.0
|
||||||
|
if($request->user()) {
|
||||||
|
// unless they force static view
|
||||||
|
if(!$request->has('fs') || $request->input('fs') != '1') {
|
||||||
|
$pid = AccountService::usernameToId($username);
|
||||||
|
if($pid) {
|
||||||
|
return redirect('/i/web/profile/' . $pid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$user = Profile::whereNull('domain')
|
$user = Profile::whereNull('domain')
|
||||||
->whereNull('status')
|
->whereNull('status')
|
||||||
->whereUsername($username)
|
->whereUsername($username)
|
||||||
|
|
Loading…
Reference in a new issue