You can get the logged in user like this:
- Import config:
import config from 'app/core/config'; - Access the user class like this:
console.log(config.bootData.user)
The user object looks like this:
{
"isSignedIn": true,
"id": 1,
"login": "admin",
"email": "admin@localhost",
"name": "admin",
"lightTheme": false,
"orgCount": 6,
"orgId": 1,
"orgName": "Main Org.",
"orgRole": "Admin",
"isGrafanaAdmin": true,
"gravatarUrl": "/avatar/46d229b033af06a191ff2267bca9ae56",
"timezone": "browser",
"locale": "sv",
"helpFlags1": 0
}