Update routes, add legacy webfinger profile redirect
This commit is contained in:
parent
07321b021c
commit
93c7af7464
2 changed files with 16 additions and 0 deletions
|
@ -139,4 +139,19 @@ class SiteController extends Controller
|
|||
|
||||
return redirect($url);
|
||||
}
|
||||
|
||||
public function legacyWebfingerRedirect(Request $request, $username, $domain)
|
||||
{
|
||||
$un = '@'.$username.'@'.$domain;
|
||||
$profile = Profile::whereUsername($un)
|
||||
->firstOrFail();
|
||||
|
||||
if($profile->domain == null) {
|
||||
$url = "/$profile->username";
|
||||
} else {
|
||||
$url = $request->user() ? "/i/web/profile/_/{$profile->id}" : $profile->url();
|
||||
}
|
||||
|
||||
return redirect($url);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue