Skip to content

Commit 9619c6e

Browse files
committed
chore: remove password generation as part of nuxt-auth-utils
1 parent 32d5e0d commit 9619c6e

File tree

2 files changed

+0
-13
lines changed

2 files changed

+0
-13
lines changed

playground/.env.example

-1
This file was deleted.

src/module.ts

-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { defineNuxtModule, createResolver, logger, addServerScanDir } from '@nuxt/kit'
22
import { join } from 'pathe'
33
import { defu } from 'defu'
4-
import { randomUUID } from 'uncrypto'
54
import { mkdir, writeFile, readFile } from 'node:fs/promises'
65
import { findWorkspaceDir } from 'pkg-types'
76
import { readUser } from 'rc9'
@@ -158,17 +157,6 @@ export default defineNuxtModule<ModuleOptions>({
158157
// Add server plugin
159158
nuxt.options.nitro.plugins = nuxt.options.nitro.plugins || []
160159
nuxt.options.nitro.plugins.push(resolve('./runtime/server/plugins/cloudflare.dev'))
161-
162-
// Generate the session password
163-
if (!process.env.NUXT_SESSION_PASSWORD) {
164-
process.env.NUXT_SESSION_PASSWORD = randomUUID().replace(/-/g, '')
165-
// Add it to .env
166-
const envPath = join(rootDir, '.env')
167-
const envContent = await readFile(envPath, 'utf-8').catch(() => '')
168-
if (!envContent.includes('NUXT_SESSION_PASSWORD')) {
169-
await writeFile(envPath, `${envContent ? envContent + '\n' : envContent}NUXT_SESSION_PASSWORD=${process.env.NUXT_SESSION_PASSWORD}`, 'utf-8')
170-
}
171-
}
172160
}
173161
})
174162

0 commit comments

Comments
 (0)