Skip to content

Commit

Permalink
fix: don't log warning about password when preparing types
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Nov 7, 2023
1 parent 74f452c commit 804057b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ export default defineNuxtModule<ModuleOptions>({
const resolver = createResolver(import.meta.url)

if (!process.env.NUXT_SESSION_PASSWORD) {
console.warn('No session password set, using a random password, please set NUXT_SESSION_PASSWORD in your .env file with at least 32 chars')
const randomPassword = sha256(`${Date.now()}${Math.random()}`).slice(0, 32)
console.log(`NUXT_SESSION_PASSWORD=${randomPassword}`)
process.env.NUXT_SESSION_PASSWORD = randomPassword
if (!nuxt.options._prepare) {
console.warn('No session password set, using a random password, please set NUXT_SESSION_PASSWORD in your .env file with at least 32 chars')
console.log(`NUXT_SESSION_PASSWORD=${randomPassword}`)
}
}

// App
Expand Down

0 comments on commit 804057b

Please sign in to comment.