diff --git a/api/funkwhale_api/federation/tasks.py b/api/funkwhale_api/federation/tasks.py index 86bef50e1127a4c26c7ccc92af9b971961f04976..c2bdfad347bc9d35fda9025d18d657c1a4df3ac1 100644 --- a/api/funkwhale_api/federation/tasks.py +++ b/api/funkwhale_api/federation/tasks.py @@ -429,7 +429,7 @@ def fetch(fetch_obj): ) except Exception: logger.exception( - "Error while fetching actor outbox: %s", obj.actor.outbox.url + "Error while fetching actor outbox: %s", obj.actor.outbox_url ) else: if result.get("next_page"): diff --git a/changes/changelog.d/1210.enhancement b/changes/changelog.d/1210.enhancement new file mode 100644 index 0000000000000000000000000000000000000000..a41d714e51a337fea53c7a0b0a746a9308328ed7 --- /dev/null +++ b/changes/changelog.d/1210.enhancement @@ -0,0 +1 @@ +Enforce authentication when viewing remote channels, profiles and libraries (#1210) \ No newline at end of file diff --git a/front/src/views/auth/ProfileBase.vue b/front/src/views/auth/ProfileBase.vue index 353ab1581c5f7bc5a474b659d5671ece13218730..2569e2ce0458b69877e1805943b52d85cdafde9c 100644 --- a/front/src/views/auth/ProfileBase.vue +++ b/front/src/views/auth/ProfileBase.vue @@ -93,7 +93,12 @@ export default { } }, created() { - this.fetch() + let authenticated = this.$store.state.auth.authenticated + if (!authenticated && this.domain && this.$store.getters['instance/domain'] != this.domain) { + this.$router.push({name: 'login', query: {next: this.$route.fullPath}}) + } else { + this.fetch() + } }, beforeRouteUpdate (to, from, next) { to.meta.preserveScrollPosition = true diff --git a/front/src/views/channels/DetailBase.vue b/front/src/views/channels/DetailBase.vue index be8481dafbf6637ca33242e78944f265f1eecf10..f111967524c1fba921a30ffbc5c4367b1d42de0d 100644 --- a/front/src/views/channels/DetailBase.vue +++ b/front/src/views/channels/DetailBase.vue @@ -270,6 +270,10 @@ export default { }, async created() { await this.fetchData() + let authenticated = this.$store.state.auth.authenticated + if (!authenticated && this.$store.getters['instance/domain'] != this.object.actor.domain) { + this.$router.push({name: 'login', query: {next: this.$route.fullPath}}) + } }, methods: { async fetchData() { diff --git a/front/src/views/library/DetailBase.vue b/front/src/views/library/DetailBase.vue index a58a179be6a402687806b46fc3a8045736267755..efd0d18fc865be9cedc3c83a392bb661bb1dfea9 100644 --- a/front/src/views/library/DetailBase.vue +++ b/front/src/views/library/DetailBase.vue @@ -148,6 +148,10 @@ export default { }, async created() { await this.fetchData() + let authenticated = this.$store.state.auth.authenticated + if (!authenticated && this.$store.getters['instance/domain'] != this.object.actor.domain) { + this.$router.push({name: 'login', query: {next: this.$route.fullPath}}) + } }, methods: { async fetchData() {