Logout Menu Item


(cpradio) #1

EDIT this is now a site setting, search for “logout”


With the removal of the Logout from all menu items, for those who still wish to allow all users the same accessibility to logout as they can to login, there is now a plugin for that.

It currently uses existing locale strings, so all of the existing languages that have been translate, benefit immediately.

It also calls the underlying User.logout() so any changes that may occur in Core (apart from moving that to a different location, will also be benefited by this plugin)

Plugin is located at

Screenshot


Feedback on new :hamburger: and user menus
(Jonathan Pautsch) #2

Nice. Yeah a link at the very bottom of the user menu (even below notifications) would be my ideal solution. Will be nice when that hook is available for plugins.


(Sam Saffron) #3

I added an extension point below notifications and you can do this in a site customization per howto today, this feels like a completely arbitrary place for logout.


(Jonathan Pautsch) #4

I can understand that. Was more meant to de-emphasize it. A glyph would work as well, but it’s not really as important as those links.


(cpradio) #5

It is now in the User Menu.


(Jonathan Pautsch) #6

The spacing seems a little off (less padding) compared to the other links, what classes is it using?


Feedback on new :hamburger: and user menus
(cpradio) #7

Yeah, I know, but once you add that padding it forces a scrollbar, so choose your poison.

You can add the padding using (if my memory serves me right)

.logout-menu-item a { padding: 0.25em 0.5em; }

(cpradio) #8

I guess, I could put padding: 0 0.5em; so it at least aligns horizontally…


Feedback on new :hamburger: and user menus
(Robin Ward) #9

Awesome, I’m definitely going to be installing this locally as I log out while developing all the time.


(Cyrus Stoller) #10

This great. Thanks for sharing.

Out of curiosity, why is the logout button being removed?


(Wes Osborn) #11

See the full history over here:

In my searching, this will make Discourse somewhat unique as every other web property I looked at had a Log out option available from every page. Thanks @cpradio for this plugin as I think it would be something we would get questions about from our users.


(cpradio) #12

Please do give me any feedback regarding styling (as I went really simple at this point). So if you prefer horizontal alignment, that is an easy change I can make. The vertical padding is a bit more complicated due to scrolling.


(Neil Lalonde) #13

I prefer it even simpler, without the glyph. But it’s better to have it and hide it with custom CSS. Thanks for the plugin!


(Daniel M ) #14

If only this plugin was a default one *sigh*
I still think that more people want the logout built in, even if it was a checkbox on the admin panel.


(Michael Downey) #15

Thank you @cpradio!

Is this ready for production use at this point? We consider it a serious security risk to have taken away the Log Out link, because a large portion of our users are on shared systems.


(cpradio) #16

Yes, if you don’t mind the minor styling possible issues (horizontal alignment slightly off) – scroll up to see a possible solution for that.

I’ve confirmed this to work on a couple of systems I have for dev purposes.


(Michael Downey) #17

Fantastic. We just installed it and Log Out is back!

However … at least on Firefox latest on Fedora, if I click “Log Out” nothing visibly happens in the UI. I would think I’m still logged in but if I reload the browser, I am actually logged out.


(cpradio) #18

Does that happen when you use the Profile Logout button too?


(Michael Downey) #19

Nope; when using that we’re redirected to / and signed out with the global announcement banner message, etc.


(cpradio) #20

K, I’ll see what I can figure out.