# User-authentication.js set global values

**URL:** <https://discourse.nodered.org/t/user-authentication-js-set-global-values/21804>\
**Category:** Core Development\
**Created:** [16 February 2020 16:53 UTC](https://discourse.nodered.org/t/user-authentication-js-set-global-values/21804 "2020-02-16T16:53:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajasekharmullangi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rajasekharmullangi/32/17501_2.png) [@rajasekharmullangi](https://discourse.nodered.org/u/rajasekharmullangi)\
**Post date:** [16 February 2020 16:53 UTC](https://discourse.nodered.org/t/user-authentication-js-set-global-values/21804/1 "2020-02-16T16:53:00Z")

</div>

Once user authenticated successful, I want to set some value in global context scope.  
How to access global object to set data in user-authentication.js.

I tried below, but no luck:  
var globalContext = this.context().global;

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [16 February 2020 17:04 UTC](https://discourse.nodered.org/t/user-authentication-js-set-global-values/21804/2 "2020-02-16T17:04:52Z")

</div>

The user authentication mechanism has no direct access to the context component. I can't think of any way to do it.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [16 April 2020 17:04 UTC](https://discourse.nodered.org/t/user-authentication-js-set-global-values/21804/3 "2020-04-16T17:04:56Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
