Skip to content

Commit

Permalink
Update ProfileController, redirect profile view for authed users to M…
Browse files Browse the repository at this point in the history
…etro 2.0 UI
  • Loading branch information
dansup committed Feb 18, 2022
1 parent 71dff47 commit 7f8129a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/Http/Controllers/ProfileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7f8129a

Please sign in to comment.