-
-async function getAdminTokenOrDie (url: string, username: string, password: string) {
- const accessToken = await getAccessToken(url, username, password)
- const resMe = await getMyUserInformation(url, accessToken)
- const me: User = resMe.body
-
- if (me.role !== UserRole.ADMINISTRATOR) {
- console.error('Cannot list plugins if you are not administrator.')
- process.exit(-1)
- }
-
- return accessToken
-}