mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-04-19 19:14:51 +00:00
Fix infinite redirect for users with empty usernames
This commit is contained in:
parent
67d0d3d7b1
commit
9348d58158
1 changed files with 2 additions and 1 deletions
|
@ -45,7 +45,8 @@ public class UserPage : BaseLayout
|
|||
if (this.ProfileUser == null) return this.NotFound();
|
||||
|
||||
string userSlug = this.ProfileUser.GenerateSlug();
|
||||
if (slug == null || userSlug != slug)
|
||||
// Only redirect if there is a valid slug for this user and the current slug doesn't match
|
||||
if (!string.IsNullOrWhiteSpace(userSlug) && (slug == null || userSlug != slug))
|
||||
{
|
||||
return this.Redirect($"~/user/{userId}/{userSlug}");
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue