Skip to content

Commit

Permalink
fix: assume untrusted user before config receival (#1065)
Browse files Browse the repository at this point in the history
Fixes a theme loading race condition on setups where FORCE_LOGINS is turned on, resulting in a 401.
Assumes FORCE_LOGINS is enabled when the configuration hasn't been received yet.

Signed-off-by: Mathis Mensing <github@matmen.dev>
  • Loading branch information
matmen committed Mar 12, 2023
1 parent 6a8f9ca commit f454b9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mixins/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class FilesMixin extends Vue {
get isTrustedUser () {
const forceLogins = this.$store.getters['server/getConfig'].authorization.force_logins

return !forceLogins || this.$store.getters['auth/getCurrentUser']?.username === '_TRUSTED_USER_'
return forceLogins === false || this.$store.getters['auth/getCurrentUser']?.username === '_TRUSTED_USER_'
}

getThumbUrl (thumbnails: Thumbnail[], path: string, large: boolean, date?: number) {
Expand Down

0 comments on commit f454b9d

Please sign in to comment.