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 Protected Pages Show Blank Screen Instead of Redirecting to Login #6738

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Shyam-Raghuwanshi
Copy link
Contributor


If your pull request closes an open issue, include the exact text below, immediately followed by the issue number. When your pull request gets merged, then that issue will close automatically.

Closes #6736

@Shyam-Raghuwanshi Shyam-Raghuwanshi marked this pull request as draft February 10, 2025 06:24
Copy link

netlify bot commented Feb 10, 2025

Deploy Preview for plone-components canceled.

Name Link
🔨 Latest commit a5736b9
🔍 Latest deploy log https://app.netlify.com/sites/plone-components/deploys/67a99b886504500008c472b8

Copy link

netlify bot commented Feb 10, 2025

Deploy Preview for plone-components canceled.

Name Link
🔨 Latest commit f807ba6
🔍 Latest deploy log https://app.netlify.com/sites/plone-components/deploys/67ab0185aeb41e00088b9428

@Shyam-Raghuwanshi
Copy link
Contributor Author

Hi @stevepiercy, I was thinking we could handle the issue this way. Does this approach seem correct, or am I missing something?

@stevepiercy
Copy link
Collaborator

@Shyam-Raghuwanshi sorry, I'm not the person to ask, as I merely review documentation for Volto. That said, I remembered this recent addition to documentation that I think is relevant to the issue.

https://6.docs.plone.org/volto/configuration/how-to.html#noncontentroutes-and-noncontentroutespublic

However, that only defines a set of route names, and not how to actually handle them correctly. That's about all I know. I hope that gives you a lead.

Copy link
Member

@davisagli davisagli left a comment

Choose a reason for hiding this comment

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

This is not perfect, because there are users who are logged in but don't have permission to access control panels. It's better than nothing. But, we should really figure out a consistent way to apply it to all control panel routes, not just the /controlpanel/:id route

packages/volto/src/helpers/Api/Api.js Outdated Show resolved Hide resolved
@Shyam-Raghuwanshi
Copy link
Contributor Author

@davisagli Could we use the ProtectedRoutes component to check permissions using the token like what permissions does user have? Since we already use ProtectedRoutes for the /controlpanel/:id route, we could extend it to all routes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Protected Pages Show Blank Screen Instead of Redirecting to Login
3 participants