Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix media-viewer on private pages #3288

Merged
merged 1 commit into from
Apr 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions apps/media-viewer/src/Mediaviewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default {
}
},
headers () {
if (!this.publicPage()) {
if (!this.isPublicContext()) {
return null
}

Expand All @@ -105,7 +105,7 @@ export default {
a: 1
})

if (this.publicPage()) {
if (this.isPublicContext()) {
const path = [
'..',
'dav',
Expand Down Expand Up @@ -164,6 +164,12 @@ export default {
},

methods: {
isPublicContext () {
// TODO: Can we rely on not being "authenticated" while viewing a public link?
// Currently it works. We cannot use publicPage() because that will still return
// true when opening the mediaviewer from authenticated routes
return !this.isAuthenticated
},
loadImage () {
this.loading = true

Expand Down
5 changes: 5 additions & 0 deletions changelog/unreleased/fix_media_viewer_on_private_pages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: fix media-viewer on private pages

media-viewer incorrectly assumed it was on a public page when opened from a private page.

https://github.com/owncloud/phoenix/pull/3288