In a drupal site where the view published content permission is not granted to anoymous users, its not possible to use a standard page as the destination.
This patch allows a custom destination page to be created and configured in the redirect after logout configuration and then is accessible by all users.
Thanks, Dan Phin for the inspiration idea.
Comments
Comment #2
b.ravanbakhshpatch attached.
Comment #3
b.ravanbakhshComment #4
b.ravanbakhshComment #5
b.ravanbakhshComment #6
b.ravanbakhshbetter naming for config keys.
Comment #7
b.ravanbakhshjust full_html or any filter format that is not restrict HTML tags are allowed.
Comment #8
b.ravanbakhshFix a missing single quote.
Comment #9
b.ravanbakhshFix missing couple of single quotes
allow access true to the dynamically created logout route.
Comment #10
singularoNo longer works with latest release.
Comment #11
nevergone@singularo
In progress.
Comment #12
nevergone#3222748-9: Create a page if given internal path is not valid patch ported, base commit: 0cd5e09
Comment #13
nevergoneComment #14
nevergone#3222748-13: Create a page if given internal path is not valid patch is rerolled, base commit: ed7aa05b2bcb6f9dcd37d1d8909c0a472d710aa9
Comment #15
nevergoneConfusion:
However, if the route already exists, the logout page will not be displayed.
I don't think that's right. If the " Dynamically create page after logout for above route" is checked, then it should not be possible to specify a route that already exists.
What do you guys think about this?
Comment #16
b.ravanbakhsh@nevergone, thanks for reroll.
regarding comment 15, when I tested with an existing page it worked and show the redirect logout page body rather than the existing page content. maybe you need to clear cache.
also, I suggest we inject the router.builder and clear cache at the end of submitForm at redirect_after_logout/src/Form/RedirectLogoutSettings.php:233
Comment #19
nevergoneNext questions:
We have a specified page: logout page
Comment #20
b.ravanbakhshRe 1:
if an authenticated user goes to the redirected after logout page can view the page body and no issue. in patch also it is '_access' => 'TRUE'
Re 2: the token I am using on my page is [site:URL] which is a general
Re 3: will add patch today
Comment #21
nevergoneRe 1: I'm not sure if this exit page is available to everyone (both logged in users and search engines).
Re 2: The [site:URL] token is general, but user related tokens not.
Comment #22
nevergoneRelated: https://drupal.stackexchange.com/questions/314288/logged-in-user-data-af...
Comment #23
prashant.cI have a few points:
1. This newly created dynamic page will have theming issues as well, the layout could be off in some themes.
2. To handle the scenario of users not having permission to some pages we could have a separate feature of having different redirect URLs for different roles in the website.
Let me know your thoughts on this.
Comment #24
nevergoneI don't know.
I'm not sure that page creation should be provided for us when there are so many ways to create pages, e.g. Page manager.
Maybe it would be enough to give an option in the access control to allow logged out users to view the page. And tokens for logged out user details.
Comment #25
prashant.c@nevergone
Can you provide an update on whether this feature will be added to the module, and if not, could you suggest a way forward?
Comment #26
gigimaorThis one should work with version 1.2
Comment #27
gigimaorComment #28
gigimaorComment #29
gigimaorThis one should work with version 1.2
Comment #30
nevergoneContrib blocker, related issue: #3023104: Introduce "Vary" page cache response policy
The essence of the issue is real and it would be a good idea to make it. But I think we're headed in the wrong direction. This module should not be tasked with creating a page. In particular, this internal page is not able to interact with other modules, for example: Layout Builder. If we want to create a page, the Page Manager module is much more useful for that.
I think it is a bad idea to create a logout page that is available to all anonymous users. This page should only be accessible to users who have actually logged out.
This module should provide support in this, but the Drupal core should also develop for this. My opinion is that we should postpone this task for the time being and think again after the Drupal core has been improved. See related issue.
Comment #31
gigimaorThe idea of this patch is to have the option to have the logout page as part of the configuration files to save in repo without the needs to create a specific node for the logout page.
This patch is an update for version 1.3 and works well in Drupal 10.
Comment #32
gigimaorSupport version 2.0.0
Tested on Drupal 11.1