Can't access UserName in App

273
1
Jump to solution
03-31-2022 01:29 PM
MichaelWen_Timmons
New Contributor III
I'm developing an EB app that has a custom widget. 
In the widget I am using this line to grab the current user name. The idea is to run a query based on username to limit what shows on the map widget.
 
getAppStore()?.getState().user.username
 
This works like a charm in my local development environment.
However, when I download the app and run it on my local IIS, 
getAppStore()?.getState().user is always null and I couldn't get any username.
Does anyone know what's wrong?
0 Kudos
1 Solution

Accepted Solutions
Grant-S-Carroll
Esri Contributor

Is your application running anonymously? eg when you navigate to it, is the user required to login? When running in the dev environment you generally have to login. If the app is running without a user having to login, then no session would be generated. So the user will be null.

View solution in original post

0 Kudos
1 Reply
Grant-S-Carroll
Esri Contributor

Is your application running anonymously? eg when you navigate to it, is the user required to login? When running in the dev environment you generally have to login. If the app is running without a user having to login, then no session would be generated. So the user will be null.

0 Kudos