-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dont allow community urls like /c/{id} (fixes #611) #612
Conversation
This is also an issue for usernames, which is in
I kinda think the 2nd option is best, because there might be some numeric fetching that we're using that I'm missing right now. |
Removed it from profile.tsx as well. I dont think it makes sense to keep around legacy code because "it might still be used somewhere". That way we will just keep adding more logic that needs to be maintained, with no benefit for anyone. Edit: nevermind, i tried to remove those params and it already causes issues with federation tests which seem tricky to fix. And besides, its much easier for a client dev to request users/communities by id, than constructing the |
} else { | ||
id = Number(idOrName); | ||
} | ||
let name_ = idOrName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just do
let name_ = pathSplit[2];
}; | ||
setOptionalAuth(form, req.auth); | ||
this.setIdOrName(form, person_id, username); | ||
form.username; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line might have got in by accident.
}; | ||
setOptionalAuth(form, req.auth); | ||
this.setIdOrName(form, person_id, username); | ||
form.username = username; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is redundant now since you have the username in the form above.
4f176a7
to
f3c7a2c
Compare
f3c7a2c
to
405faa2
Compare
If the community identifier in url can be interpreted as a valid integer, lemmy-ui considers it as community id, which breaks things if a community has a name with only numbers.