downey
(Michael Downey)
29 مارس 2016، 1:58ص
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)
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)
sam
(Sam Saffron)
29 مارس 2016، 2:19ص
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)
29 مارس 2016، 2:20ص
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)
29 مارس 2016، 2:24ص
5
You could probably use a site customization to add to hamburger, but seems like a poor fit conceptually
downey
(Michael Downey)
29 مارس 2016، 2:32ص
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)
I thought we had discussed a keyboard shortcut for this?
إعجاب واحد (1)
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 إعجابات
downey
(Michael Downey)
29 مارس 2016، 2:00م
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)
29 مارس 2016، 2:06م
11
It is on the keyboard shortcut menu
إعجابَين (2)
pfaffman
(Jay Pfaffman)
29 مارس 2016، 8:08م
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)
downey
(Michael Downey)
29 مارس 2016، 8:35م
13
pfaffman:
Because vi.
Meh, I use :wq
. (Old-school.)
إعجاب واحد (1)
pfaffman
(Jay Pfaffman)
29 مارس 2016، 8:40م
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)
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 إعجابات
This topic was automatically closed after 2993 days. New replies are no longer allowed.