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

Fix media-viewer on private pages #3288

merged 1 commit into from
Apr 6, 2020

Conversation

dschmidt
Copy link
Member

@dschmidt dschmidt commented Apr 2, 2020

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
Copy link

update-docs bot commented Apr 2, 2020

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
Copy link

CLAassistant commented Apr 2, 2020

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
@LukasHirt
Copy link
Contributor

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

@dschmidt
Copy link
Member Author

dschmidt commented Apr 6, 2020

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.

Copy link
Contributor

@LukasHirt LukasHirt left a comment

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
Contributor

@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
Copy link
Member Author

dschmidt commented Apr 6, 2020

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 join this conversation on GitHub. Already have an account? Sign in to comment
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