Skip to content

Commit 7c5361b

Browse files
Merge pull request #7523 from christianbeeznest/fixes-updates259
Social: Use uid instead of id for social wall user loading (restrict to /social route)
2 parents c13fb1a + 6afade2 commit 7c5361b

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

assets/vue/composables/useSocialInfo.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,25 @@ export function useSocialInfo() {
4242
}
4343
const loadUser = async () => {
4444
try {
45+
const isSocialRoute = route.path.includes("/social")
4546
const uid = route.query.uid
46-
if (uid) {
47+
48+
// Only allow uid usage inside /social
49+
if (isSocialRoute && uid) {
4750
const params = { ...route.query }
48-
// Ensure id is never used even if present.
4951
delete params.id
5052

51-
if (route.path.includes("/social")) {
52-
params.page_origin = "social"
53-
}
53+
params.page_origin = "social"
5454
const response = await axios.get(`/api/users/${uid}`, { params })
5555
user.value = response.data
5656
isCurrentUser.value = false
5757
} else {
5858
user.value = securityStore.user
5959
isCurrentUser.value = true
6060
}
61-
} catch (e) {
62-
user.value = {}
61+
} catch (error) {
62+
console.error("Error loading user:", error)
63+
user.value = securityStore.user
6364
isCurrentUser.value = true
6465
}
6566
}

0 commit comments

Comments
 (0)