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

LogoutRedirect #1003

Closed
angrybrad opened this issue Jan 31, 2017 · 6 comments
Closed

LogoutRedirect #1003

angrybrad opened this issue Jan 31, 2017 · 6 comments
Assignees

Comments

@angrybrad
Copy link
Member

@angrybrad angrybrad commented Jan 31, 2017

Created by: James Lindeman (mail@jameslindeman.co.uk) on 2015/12/14 18:57:51 +0000
Votes at time of UserVoice import: 6


As the docs say, ‘The URL Craft uses to log users out, based on the logoutPath config setting. Note that Craft will automatically redirect users to your homepage after going here; there’s no such thing as a “logout page”.’

How about a logoutRedirect for general config settings to specify where users get redirected to after logging out.

@jan-dh

This comment has been minimized.

Copy link

@jan-dh jan-dh commented Apr 20, 2017

Would be really nice to be able to set the redirectUrl in the template

brandonkelly added a commit that referenced this issue Apr 20, 2017
@brandonkelly brandonkelly self-assigned this Apr 20, 2017
@jan-dh

This comment has been minimized.

Copy link

@jan-dh jan-dh commented Apr 24, 2017

Any chance of making it more dynamic, so you could for example redirect the user to the same page but in a logged out state?

@brandonkelly

This comment has been minimized.

Copy link
Member

@brandonkelly brandonkelly commented Apr 24, 2017

The logout action doesn’t require a POST request like other actions that accept a redirect param. So no, that wouldn’t make sense here.

However I’ve just updated it to accept a PHP callable (26d9658 and 16e9d2a), so if you really wanted to do that, you could:

'postLogoutRedirect' => function($siteHandle) {
     return Craft::$app->request->getParam('redirect', 'default/path');
},
@daniellelecomte

This comment has been minimized.

Copy link

@daniellelecomte daniellelecomte commented May 18, 2017

This is only available in Craft 3, right?

@brandonkelly

This comment has been minimized.

Copy link
Member

@brandonkelly brandonkelly commented May 18, 2017

@madebyspark correct, wouldn't be easy to replicate the feature in Craft 2 unfortunately.

@daniellelecomte

This comment has been minimized.

Copy link

@daniellelecomte daniellelecomte commented May 19, 2017

No worries - just checking as it comes up often. Thx @brandonkelly

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

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.