Skip to content

Commit

Permalink
fix: do not expose token in public runtime config (#41)
Browse files Browse the repository at this point in the history
* fix: do not expose token in public runtime config

* fix: remove formatting change

* refactor: avoid setting token in first place
  • Loading branch information
danielroe authored Apr 11, 2023
1 parent 140314f commit 5490c43
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export default defineNuxtModule<ModuleOptions>({
owner: options.owner || process.env.GITHUB_OWNER,
branch: options.branch || process.env.GITHUB_BRANCH,
repo: options.repo || process.env.GITHUB_REPO,
token: options.token || process.env.GITHUB_TOKEN,
disableCache: options.disableCache,
parseContents: options.parseContents,
maxContributors: options.maxContributors
Expand All @@ -79,7 +78,9 @@ export default defineNuxtModule<ModuleOptions>({
// @ts-ignore
nuxt.options.runtimeConfig.public.github = defu(nuxt.options.runtimeConfig.public.github, config)
// @ts-ignore
nuxt.options.runtimeConfig.github = defu(nuxt.options.runtimeConfig.github, config)
nuxt.options.runtimeConfig.github = defu(nuxt.options.runtimeConfig.github, {
token: options.token || process.env.GITHUB_TOKEN
}, config)

// Autolink issue/PR/commit links using `remark-github` plugin
if (options.remarkPlugin) {
Expand Down

0 comments on commit 5490c43

Please # to comment.