Update ProfileController, redirect profile view for authed users to Metro 2.0 UI

pull/3264/head
Daniel Supernault 2022-02-18 03:38:35 -07:00
rodzic 71dff472cc
commit 7f8129a75c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 0DEF1C662C9033F7
1 zmienionych plików z 11 dodań i 0 usunięć

Wyświetl plik

@ -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)