Skip to content

Commit

Permalink
feat(katzencore): Removed default user for security reasons
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximilian Schleining committed Aug 12, 2024
1 parent 3ee8fbc commit 7bc725d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
6 changes: 6 additions & 0 deletions playground/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,11 @@ export default defineNuxtConfig({
katze: {
projectLocation: './playground',
secret: 'secret123',
users: [
{
name: 'admin',
password: 'admin123',
}
]
},
})
17 changes: 11 additions & 6 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,7 @@ export default defineNuxtModule<ModuleOptions>({
},
// Default configuration options of the Nuxt module
defaults: {
users: [
{
name: 'admin',
password: 'admin',
},
],
users: [],
secret: 'secret',
projectLocation: './',
storage: {
Expand All @@ -65,6 +60,16 @@ export default defineNuxtModule<ModuleOptions>({
},
)

if(_options.users.length === 0) {
katzeError('No users found in the configuration adding default user')
_options.users = [
{
name: 'admin',
password: 'admin',
},
]
}

// SET RUNTIME CONFIG
_nuxt.options.runtimeConfig.users = _options.users
_nuxt.options.runtimeConfig.secret = _options.secret
Expand Down

0 comments on commit 7bc725d

Please sign in to comment.