Skip to content

Commit

Permalink
Merge pull request #1379 from nextcloud/do-not-fetch-user-status-if-c…
Browse files Browse the repository at this point in the history
…urrent-user-is-a-guest

Do not fetch user status if current user is a guest
  • Loading branch information
georgehrke authored Sep 3, 2020
2 parents 7618fc1 + d848cf0 commit e4ba3a1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/mixins/userStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import axios from '@nextcloud/axios'
import { generateOcsUrl } from '@nextcloud/router'
import { getCapabilities } from '@nextcloud/capabilities'
import { getCurrentUser } from '@nextcloud/auth'

export default {
data() {
Expand All @@ -47,6 +48,11 @@ export default {
return
}

// User status endpoint is not available for guests.
if (!getCurrentUser()) {
return
}

try {
const { data } = await axios.get(generateOcsUrl('apps/user_status/api/v1', 2) + `statuses/${encodeURIComponent(userId)}`)
const {
Expand Down

0 comments on commit e4ba3a1

Please sign in to comment.