Hi,
I have secured the acces of Node RED by setting up nginx. Then, i wanted to know the username of the person connected to the dashboard. So i added a middleware to the settings.js file. The code is below
dashboard: {
middleware: (request, response, next) => {
const Username = request.headers['x-auth-user'];
console.log(Username);
next()
}
},
When i connect to the dashboard, i get the username write in the console, as you can see below.
Now i want to get the username to the node red flows, but i don't know how to do it. I tried to use functionGlobalContext, but i figured that the list just update at the launch of node red. So when another user connect to the dashboard, the variable doesn't get refresh, and the variable in node red says "undefined".
Is there a way to store the current username in a global (or flow) variable, and have it automatically update whenever a new user connects to the dashboard?
Thanks already for your help !
