downey
(Michael Downey)
March 29, 2016, 1:58am
1
Continuing the discussion from Logging out dismisses notification count :
Once again we had a complaint that someone can’t log out without dismissing notification count. This really stinks.
This is also a problem when impersonating a user, because you can’t stop the impersonation session without dismissing their notifications without their permission.
Question: How can we add a log out link in a place that won’t be so disruptive?
1 Like
As a workaround I usually:
open a Chrome Incognito window
login as myself
impersonate
just close Incognito window to logout.
This specifically avoids executing the “logout” which would log users out of all sessions on all devices.
EDIT:
Alternatively if the Discourse instance uses SSO against another authentication provider then you can just visit '/session/sso` and that will log you back in as yourself.
2 Likes
sam
(Sam Saffron)
March 29, 2016, 2:19am
3
Log out is usually a bad fit for finishing impersonation. It will log the user out everywhere.
Instead either use incognito as @DeanMarkTaylor said or delete cookies
downey
(Michael Downey)
March 29, 2016, 2:20am
4
Thanks to the disabled log out strict site setting we don’t participate in such default nonsense.
That said, anyone with ideas to my original question about how to add a Log Out link somewhere else in the UI other than the notification list?
sam
(Sam Saffron)
March 29, 2016, 2:24am
5
You could probably use a site customization to add to hamburger, but seems like a poor fit conceptually
downey
(Michael Downey)
March 29, 2016, 2:32am
6
Really? Isn’t that where it used to be?
EDIT: I went back and looked and yes, it was always under the user icon, but the notifications had their own menu and weren’t there to get in the way of account actions back in the day.
1 Like
I thought we had discussed a keyboard shortcut for this?
1 Like
It is a poor fit - but here is how it could be done - but I don’t like it - way to accessible for the average user to shoot themselves in the foot:
Added to </head>
customisation:
<script type='text/x-handlebars' data-template-name='/connectors/site-map-links-last/log-out'>
{{#if currentUser}}
<li>{{d-link action="logout" class="logout" icon="sign-out" label="user.log_out"}}</li>
{{/if}}
</script>
<script type="text/discourse-plugin" version="0.1">
var HamburgerMenuComponent = require('discourse/components/hamburger-menu').default;
HamburgerMenuComponent.reopen({
actions: {
logout: function() {
this.container.lookup('controller:application').send('logout')
}
}
});
</script>
EDIT: Actually this doesn’t quite work clicking the logout, just reloads the page for me
EDIT: Got it working with additional script block
4 Likes
downey
(Michael Downey)
March 29, 2016, 2:00pm
10
This works, but why so cryptic and not just a single Shift +Z (and be placed on the keyboard shortcut help menu?)
Some of the comments here make it sound like logging out is some kind of horrible action…
cpradio
(cpradio)
March 29, 2016, 2:06pm
11
It is on the keyboard shortcut menu
2 Likes
pfaffman
(Jay Pfaffman)
March 29, 2016, 8:08pm
12
A UX answer: What else would you do with Z? If it were a single Z
then it would be too easy to do it by mistake.
The real answer: Because vi .
1 Like
downey
(Michael Downey)
March 29, 2016, 8:35pm
13
pfaffman:
Because vi.
Meh, I use :wq
. (Old-school.)
1 Like
pfaffman
(Jay Pfaffman)
March 29, 2016, 8:40pm
14
Me too, in spite of the two extra keystrokes.
Most Discourse users, though, are more familiar with vi than ed. I suggested ^X^C, but it was a non-starter.
2 Likes
Also another workaround…
If the Discourse instance uses SSO against another authentication provider…
Then you can just visit /session/sso
and that will log you back in as yourself.
3 Likes
This topic was automatically closed after 2993 days. New replies are no longer allowed.