Redirect self route to username
cgen-8c25da38059647319613ac79c25a0a15
This commit is contained in:
parent
f08a680afb
commit
6cf0485648
1 changed files with 16 additions and 0 deletions
|
|
@ -81,6 +81,22 @@ const ProfilePassport = () => {
|
||||||
|
|
||||||
if (isSelfRoute) {
|
if (isSelfRoute) {
|
||||||
const currentUser = await aethexUserService.getCurrentUser();
|
const currentUser = await aethexUserService.getCurrentUser();
|
||||||
|
|
||||||
|
if (currentUser?.username) {
|
||||||
|
if (!requestedUsername || requestedUsername === "me") {
|
||||||
|
navigate(`/passport/${currentUser.username}`, { replace: true });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
currentUser.username.toLowerCase() === requestedUsername.toLowerCase() &&
|
||||||
|
currentUser.username !== requestedUsername
|
||||||
|
) {
|
||||||
|
navigate(`/passport/${currentUser.username}`, { replace: true });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (currentUser) {
|
if (currentUser) {
|
||||||
resolvedProfile = {
|
resolvedProfile = {
|
||||||
...currentUser,
|
...currentUser,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue