Skip to content

Commit

Permalink
remove prebuilt schemas from create-keystone-app
Browse files Browse the repository at this point in the history
  • Loading branch information
dcousens committed Aug 13, 2024
1 parent 0292aa3 commit 0cbd074
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 500 deletions.
9 changes: 1 addition & 8 deletions packages/create/starter/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ import { createAuth } from '@keystone-6/auth'
// see https://keystonejs.com/docs/apis/session for the session docs
import { statelessSessions } from '@keystone-6/core/session'

// for a stateless session, a SESSION_SECRET should always be provided
// especially in production (statelessSessions will throw if SESSION_SECRET is undefined)
let sessionSecret = process.env.SESSION_SECRET
if (!sessionSecret && process.env.NODE_ENV !== 'production') {
sessionSecret = randomBytes(32).toString('hex')
}

// withAuth is a function we can use to wrap our base configuration
const { withAuth } = createAuth({
listKey: 'User',
Expand Down Expand Up @@ -60,7 +53,7 @@ const sessionMaxAge = 60 * 60 * 24 * 30
// you can find out more at https://keystonejs.com/docs/apis/session#session-api
const session = statelessSessions({
maxAge: sessionMaxAge,
secret: sessionSecret!,
secret: process.env.SESSION_SECRET,
})

export { withAuth, session }
3 changes: 1 addition & 2 deletions packages/create/starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"scripts": {
"dev": "keystone dev",
"start": "keystone start",
"build": "keystone build",
"postinstall": "keystone build --no-ui --frozen"
"build": "keystone build"
},
"dependencies": {
"@keystone-6/auth": "^8.0.0",
Expand Down
Loading

0 comments on commit 0cbd074

Please sign in to comment.