# Programmatically logout the user

**URL:** <https://discourse.nodered.org/t/programmatically-logout-the-user/9171>\
**Category:** General\
**Created:** [19 March 2019 09:07 UTC](https://discourse.nodered.org/t/programmatically-logout-the-user/9171 "2019-03-19T09:07:31Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [20 March 2019 08:59 UTC](https://discourse.nodered.org/t/programmatically-logout-the-user/9171/11 "2019-03-20T08:59:58Z")

</div>

In the following threads are examples

> [@Button in TopBar](https://discourse.nodered.org/t/button-in-topbar/6377/27):
>
> You wanna send a payload to the ui\_template and change something for the button? Or do you want the ui\_template to send out a payload (this is already working I assume)?

> [@Access msg object in dashboard ui\_template](https://discourse.nodered.org/t/access-msg-object-in-dashboard-ui-template/5502/12):
>
> Hi, not sure if you have a question or if you already solved the issue. Anyway, based on my previous example, this is how you can access the payload and assign values to other variables in the script Lets assume, you send a javascript object {"name":"jmacle"} as payload to the ui\_template node In the template node, the script captures the payload, sends it further to the debug node then extracts the "name", assigns it to you new variable bleh, and sends the value of bleh to the debug node As …

I suppose you wanna do something like

_some node in Node-RED -\> msg -\> ui template -\> extract msg.payload -\> call a javascript function to do some stuff_  
or  
_some node in Node-RED -\> msg -\> template node with your html/javascript code -\> extract msg.payload -\> call a javascript function to do some stuff_

It's unclear how your architecture looks like so best is you provide your flow "as is" and we can look at it and give further advice.

---

_[View the full topic](https://discourse.nodered.org/t/programmatically-logout-the-user/9171)._
