From 7f8129a75c8e57886286d22f557b8fb6b3bbfd1a Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 18 Feb 2022 03:38:35 -0700 Subject: [PATCH] Update ProfileController, redirect profile view for authed users to Metro 2.0 UI --- app/Http/Controllers/ProfileController.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 83872b443..7dbda1191 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -26,6 +26,17 @@ class ProfileController extends Controller { 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') ->whereNull('status') ->whereUsername($username)