# Can I add any other Log Out button somewhere?

**URL:** https://meta.discourse.org/t/can-i-add-any-other-log-out-button-somewhere/41690
**Category:** Support
**Created:** [29.Март.2016 01:58:31 UTC](https://meta.discourse.org/t/can-i-add-any-other-log-out-button-somewhere/41690 "2016-03-29T01:58:31Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [29.Март.2016 01:58:31 UTC](https://meta.discourse.org/t/can-i-add-any-other-log-out-button-somewhere/41690/1 "2016-03-29T01:58:31Z")

</div>

Continuing the discussion from [Logging out dismisses notification count](https://meta.discourse.org/t/logging-out-dismisses-notification-count/33643):

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

---

<div class="post-metadata">

### Author: ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)
#### Post date: [29.Март.2016 02:16:33 UTC](https://meta.discourse.org/t/can-i-add-any-other-log-out-button-somewhere/41690/2 "2016-03-29T02:16:33Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [29.Март.2016 02:19:06 UTC](https://meta.discourse.org/t/can-i-add-any-other-log-out-button-somewhere/41690/3 "2016-03-29T02:19:06Z")

</div>

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

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [29.Март.2016 02:20:24 UTC](https://meta.discourse.org/t/can-i-add-any-other-log-out-button-somewhere/41690/4 "2016-03-29T02:20:24Z")

</div>

> [@sam](#):
>
> It will log the user out everywhere.

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?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [29.Март.2016 02:24:11 UTC](https://meta.discourse.org/t/can-i-add-any-other-log-out-button-somewhere/41690/5 "2016-03-29T02:24:11Z")

</div>

You could probably use a site customization to add to hamburger, but seems like a poor fit conceptually

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [29.Март.2016 02:32:30 UTC](https://meta.discourse.org/t/can-i-add-any-other-log-out-button-somewhere/41690/6 "2016-03-29T02:32:30Z")

</div>

> [@sam](#):
>
> seems like a poor fit conceptually

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.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [29.Март.2016 02:40:15 UTC](https://meta.discourse.org/t/can-i-add-any-other-log-out-button-somewhere/41690/7 "2016-03-29T02:40:15Z")

</div>

I thought we had discussed a keyboard shortcut for this?

---

<div class="post-metadata">

### Author: ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)
#### Post date: [29.Март.2016 03:03:36 UTC](https://meta.discourse.org/t/can-i-add-any-other-log-out-button-somewhere/41690/8 "2016-03-29T03:03:36Z")

</div>

> [@sam](#):
>
> You could probably use a site customization to add to hamburger, but seems like a poor fit conceptually

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:

```HTML
<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

---

<div class="post-metadata">

### Author: ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)
#### Post date: [29.Март.2016 03:16:43 UTC](https://meta.discourse.org/t/can-i-add-any-other-log-out-button-somewhere/41690/9 "2016-03-29T03:16:43Z")

</div>

> [@codinghorror](#):
>
> thought we had discussed a keyboard shortcut for this?

It’s shift+z shift+z

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [29.Март.2016 14:00:09 UTC](https://meta.discourse.org/t/can-i-add-any-other-log-out-button-somewhere/41690/10 "2016-03-29T14:00:09Z")

</div>

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… 😕

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [29.Март.2016 14:06:39 UTC](https://meta.discourse.org/t/can-i-add-any-other-log-out-button-somewhere/41690/11 "2016-03-29T14:06:39Z")

</div>

> [@downey](#):
>
> and be placed on the keyboard shortcut help menu?

It is on the keyboard shortcut menu 😉

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [29.Март.2016 20:08:24 UTC](https://meta.discourse.org/t/can-i-add-any-other-log-out-button-somewhere/41690/12 "2016-03-29T20:08:24Z")

</div>

> [@downey](#):
>
> This works, but why so cryptic and not just a single Shift+Z

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](https://en.wikipedia.org/wiki/Vi "ZZ is how to quit the vi editor").

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [29.Март.2016 20:35:46 UTC](https://meta.discourse.org/t/can-i-add-any-other-log-out-button-somewhere/41690/13 "2016-03-29T20:35:46Z")

</div>

> [@pfaffman](#):
>
> Because vi.

Meh, I use `:wq`. (Old-school.)

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [29.Март.2016 20:40:38 UTC](https://meta.discourse.org/t/can-i-add-any-other-log-out-button-somewhere/41690/14 "2016-03-29T20:40:38Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)
#### Post date: [03.Апрель.2016 03:09:30 UTC](https://meta.discourse.org/t/can-i-add-any-other-log-out-button-somewhere/41690/15 "2016-04-03T03:09:30Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [08.Июнь.2024 12:45:51 UTC](https://meta.discourse.org/t/can-i-add-any-other-log-out-button-somewhere/41690/16 "2024-06-08T12:45:51Z")

</div>

Эта тема была автоматически закрыта через 2993 дня. Новые ответы больше не принимаются.
