-
Notifications
You must be signed in to change notification settings - Fork 156
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
Conversation
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. |
000ca0c
to
fb1c979
Compare
Should we close this PR since it's included in #3294 ? |
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. |
There was a problem hiding this 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.
@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. |
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 :-) |
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?
Screenshots (if appropriate):
Types of changes
Checklist: