Skip to content
Snippets Groups Projects
Commit 482647da authored by Agate's avatar Agate :speech_balloon:
Browse files

Fix #1210: Enforce authentication when viewing remote channels, profiles and libraries

parent b1ae13ab
No related branches found
No related tags found
No related merge requests found
...@@ -429,7 +429,7 @@ def fetch(fetch_obj): ...@@ -429,7 +429,7 @@ def fetch(fetch_obj):
) )
except Exception: except Exception:
logger.exception( logger.exception(
"Error while fetching actor outbox: %s", obj.actor.outbox.url "Error while fetching actor outbox: %s", obj.actor.outbox_url
) )
else: else:
if result.get("next_page"): if result.get("next_page"):
......
Enforce authentication when viewing remote channels, profiles and libraries (#1210)
\ No newline at end of file
...@@ -93,7 +93,12 @@ export default { ...@@ -93,7 +93,12 @@ export default {
} }
}, },
created() { 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) { beforeRouteUpdate (to, from, next) {
to.meta.preserveScrollPosition = true to.meta.preserveScrollPosition = true
......
...@@ -270,6 +270,10 @@ export default { ...@@ -270,6 +270,10 @@ export default {
}, },
async created() { async created() {
await this.fetchData() 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: { methods: {
async fetchData() { async fetchData() {
......
...@@ -148,6 +148,10 @@ export default { ...@@ -148,6 +148,10 @@ export default {
}, },
async created() { async created() {
await this.fetchData() 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: { methods: {
async fetchData() { async fetchData() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment