getUserToken

getUserToken is a promise function, will be resolve with the logged-in user's token

/*
    NavigaID should be imported and exported in your plugin's index.js
    Or you can import from 'Dashboard/modules' 
*/
import {
    NavigaID
} from '@root'

const userToken = await NavigaID.getUserToken()

const params = {
    scope: [
        'permission:*:dashboard:group/admin',
        'permission:*:dashboard:group/powerUser'
    ]
}

const scopedToken = await NavigaID.getUserToken(params)

Last updated