Skip to content

Commit e4ba3a1

Browse files
authored
Merge pull request #1379 from nextcloud/do-not-fetch-user-status-if-current-user-is-a-guest
Do not fetch user status if current user is a guest
2 parents 7618fc1 + d848cf0 commit e4ba3a1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/mixins/userStatus.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import axios from '@nextcloud/axios'
2323
import { generateOcsUrl } from '@nextcloud/router'
2424
import { getCapabilities } from '@nextcloud/capabilities'
25+
import { getCurrentUser } from '@nextcloud/auth'
2526

2627
export default {
2728
data() {
@@ -47,6 +48,11 @@ export default {
4748
return
4849
}
4950

51+
// User status endpoint is not available for guests.
52+
if (!getCurrentUser()) {
53+
return
54+
}
55+
5056
try {
5157
const { data } = await axios.get(generateOcsUrl('apps/user_status/api/v1', 2) + `statuses/${encodeURIComponent(userId)}`)
5258
const {

0 commit comments

Comments
 (0)