Skip to content

Commit

Permalink
Handle fail to request scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
lowlighter committed May 11, 2021
1 parent 50b93a7 commit 0759543
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion source/plugins/core/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,13 @@ export default async function({login, q}, {conf, data, rest, graphql, plugins, q
computed.avatar = await avatar || "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="

//Token scopes
computed.token.scopes = conf.settings.notoken ? [] : (await rest.request("HEAD /")).headers["x-oauth-scopes"].split(", ")
try {
computed.token.scopes = conf.settings.notoken ? [] : (await rest.request("HEAD /")).headers["x-oauth-scopes"].split(", ")
}
catch (error) {
console.debug(error)
computed.token.scopes = []
}

//Meta
data.meta = {version:conf.package.version, author:conf.package.author}
Expand Down

0 comments on commit 0759543

Please sign in to comment.