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

b.ravanbakhsh created an issue. See original summary.

b.ravanbakhsh’s picture

patch attached.

b.ravanbakhsh’s picture

Issue summary: View changes
b.ravanbakhsh’s picture

Status: Needs work » Needs review
b.ravanbakhsh’s picture

Issue summary: View changes
b.ravanbakhsh’s picture

Issue summary: View changes
StatusFileSize
new7.3 KB

better naming for config keys.

b.ravanbakhsh’s picture

just full_html or any filter format that is not restrict HTML tags are allowed.

b.ravanbakhsh’s picture

StatusFileSize
new7.36 KB

Fix a missing single quote.

b.ravanbakhsh’s picture

StatusFileSize
new8.06 KB

Fix missing couple of single quotes
allow access true to the dynamically created logout route.

singularo’s picture

Status: Needs review » Needs work

No longer works with latest release.

nevergone’s picture

@singularo
In progress.

nevergone’s picture

nevergone’s picture

  1. Drupal core includes token service (not necessary token module).
  2. DI
  3. Configuration data don't use user interface translation system! Use configuration translation, if necessary.
nevergone’s picture

#3222748-13: Create a page if given internal path is not valid patch is rerolled, base commit: ed7aa05b2bcb6f9dcd37d1d8909c0a472d710aa9

nevergone’s picture

Confusion:

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?

b.ravanbakhsh’s picture

@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

    $routerBuilder = \Drupal::service('router.builder');
    $routerBuilder->rebuild();

  • nevergone committed 5a0ee9b on 3222748-create-a-page
    Issue #3222748: settings form states test
    

  • nevergone committed aee8a4b on 3222748-create-a-page
    Issue #3222748: show page title in logout page
    
nevergone’s picture

Next questions:
We have a specified page: logout page

  1. What should happen if an authenticated user goes to the logout page?
  2. What happens if an anonymous user who has not logged out goes to the logout page?
    1. What to display in place of tokens?
  3. Should the content of the page be hidden from search engines?
b.ravanbakhsh’s picture

Re 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

nevergone’s picture

Re 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.

nevergone’s picture

prashant.c’s picture

I 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.

nevergone’s picture

I 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.

prashant.c’s picture

@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?

gigimaor’s picture

This one should work with version 1.2

gigimaor’s picture

gigimaor’s picture

gigimaor’s picture

This one should work with version 1.2

nevergone’s picture

Status: Needs work » Postponed
Related issues: +#3023104: Introduce "Vary" page cache response policy

Contrib 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.

gigimaor’s picture

The 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.

gigimaor’s picture

Version: 8.x-1.x-dev » 2.0.0
StatusFileSize
new7.48 KB

Support version 2.0.0
Tested on Drupal 11.1