Skip to content
This repository was archived by the owner on Nov 23, 2026. It is now read-only.

Fix media-viewer on private pages - #3288

Merged
dschmidt merged 1 commit into
masterfrom
fix_mediaviewer
Apr 6, 2020
Merged

dschmidt merged 1 commit into
masterfrom
fix_mediaviewer

Conversation

@dschmidt

@dschmidt dschmidt commented Apr 2, 2020 •

Copy link
Copy Markdown
Member

Description

I've made the mediaviewer app depend only on this.isAuthenticated instead of this.publicPage().

publicPage() is always true because (at least I assume so) it's rendered in its own route that is always public. In my tests I could use isAuthenticated to determine whether it was loaded from a private page or from a public link e.g.

It feels hackish, happy to hear if there's a better API to use.

Related Issue

Motivation and Context

How Has This Been Tested?

  • test environment:
  • test case 1: I looked at the picture from regular files view
  • test case 2: I looked at the file from public link view
  • ...

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@dschmidt dschmidt added the Status:Needs-Review Needs review from a maintainer label Apr 2, 2020
@dschmidt dschmidt self-assigned this Apr 2, 2020
@update-docs

update-docs Bot commented Apr 2, 2020

Copy link
Copy Markdown

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@CLAassistant

CLAassistant commented Apr 2, 2020 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@dschmidt dschmidt changed the title Fix mediaviewer Fix mediaviewer from private pages Apr 2, 2020
@dschmidt dschmidt changed the title Fix mediaviewer from private pages Fix media-viewer on private pages Apr 2, 2020
@dschmidt dschmidt mentioned this pull request Apr 3, 2020
2 of 10 tasks
@LukasHirt

Copy link
Copy Markdown
Collaborator

Should we close this PR since it's included in #3294 ?

@dschmidt

dschmidt commented Apr 6, 2020

Copy link
Copy Markdown
Member Author

It depends on the chances you see for the other PR to land soon :-)

This is the bare minimum the app needs to work at all, merging it gives us at least a roughly working app. However you like.

@LukasHirt LukasHirt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should anyway reconsider how are we checking for public pages since the current plugin in core leads either to issue like here or to displaying an error page even in when it shouldn't #1693.

@LukasHirt

Copy link
Copy Markdown
Collaborator

@dschmidt I approved the PR so feel free to merge it if you feel like it should get merged before the other PR since I am not sure how long that one will take before merging.

@dschmidt

dschmidt commented Apr 6, 2020

Copy link
Copy Markdown
Member Author

Yep, merging! :-)

And yes, full ack. It's messy and should be fixed properly in a central place. I just don't know phoenix well enough yet to have an opinion how and where it should be fixed. For now we at least have a working mediaviewer again :-)

@dschmidt
dschmidt merged commit c6cdc2d into master Apr 6, 2020
@delete-merged-branch
delete-merged-branch Bot deleted the fix_mediaviewer branch April 6, 2020 20:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Status:Needs-Review Needs review from a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

media-viewer is broken on private pages

3 participants