Skip to content

Commit 51ae55c

Browse files
committed
move sessionStrategy implementation to keystone-6/auth package
1 parent 94e12b4 commit 51ae55c

16 files changed

Lines changed: 27 additions & 21 deletions

File tree

examples/auth/keystone.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { config } from '@keystone-6/core';
2-
import { statelessSessions } from '@keystone-6/core/session';
32
import { createAuth } from '@keystone-6/auth';
3+
import { statelessSessions } from '@keystone-6/auth/session';
44
import { lists } from './schema';
55

66
/**

examples/basic/keystone.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { config } from '@keystone-6/core';
2-
import { statelessSessions } from '@keystone-6/core/session';
2+
import { statelessSessions } from '@keystone-6/auth/session';
33
import { createAuth } from '@keystone-6/auth';
44

55
import { lists, extendGraphqlSchema } from './schema';

examples/custom-session-validation/keystone.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { KeystoneConfig, SessionStrategy } from '@keystone-6/core/types';
22
import { config } from '@keystone-6/core';
3-
import { statelessSessions } from '@keystone-6/core/session';
3+
import { statelessSessions } from '@keystone-6/auth/session';
44
import { createAuth } from '@keystone-6/auth';
55
import { lists } from './schema';
66

examples/ecommerce/keystone.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createAuth } from '@keystone-6/auth';
22
import { config } from '@keystone-6/core';
3-
import { statelessSessions } from '@keystone-6/core/session';
3+
import { statelessSessions } from '@keystone-6/auth/session';
44
import { permissionsList } from './schemas/fields';
55
import { Role } from './schemas/Role';
66
import { OrderItem } from './schemas/OrderItem';

examples/redis-session-store/keystone.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { config } from '@keystone-6/core';
2-
import { storedSessions } from '@keystone-6/core/session';
2+
import { storedSessions } from '@keystone-6/auth/session';
33
import { createAuth } from '@keystone-6/auth';
44
import { createClient } from '@redis/client';
55
import { lists } from './schema';

examples/roles/keystone.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { config } from '@keystone-6/core';
2-
import { statelessSessions } from '@keystone-6/core/session';
2+
import { statelessSessions } from '@keystone-6/auth/session';
33
import { createAuth } from '@keystone-6/auth';
44
import { lists } from './schema';
55

examples/testing/keystone.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { config } from '@keystone-6/core';
2-
import { statelessSessions } from '@keystone-6/core/session';
2+
import { statelessSessions } from '@keystone-6/auth/session';
33
import { createAuth } from '@keystone-6/auth';
44
import { lists } from './schema';
55
import { TypeInfo } from '.keystone/types';

examples/with-auth/keystone.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { config } from '@keystone-6/core';
2-
import { statelessSessions } from '@keystone-6/core/session';
2+
import { statelessSessions } from '@keystone-6/auth/session';
33
import { createAuth } from '@keystone-6/auth';
44
import { lists } from './schema';
55

packages/auth/package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
"module": "./dist/keystone-6-auth.esm.js",
1010
"default": "./dist/keystone-6-auth.cjs.js"
1111
},
12+
"./session": {
13+
"module": "./session/dist/keystone-6-auth-session.esm.js",
14+
"default": "./session/dist/keystone-6-auth-session.cjs.js"
15+
},
1216
"./pages/InitPage": {
1317
"module": "./pages/InitPage/dist/keystone-6-auth-pages-InitPage.esm.js",
1418
"default": "./pages/InitPage/dist/keystone-6-auth-pages-InitPage.cjs.js"
@@ -21,14 +25,17 @@
2125
},
2226
"dependencies": {
2327
"@babel/runtime": "^7.16.3",
28+
"@hapi/iron": "^6.0.0",
2429
"@keystone-ui/button": "^7.0.2",
2530
"@keystone-ui/core": "^5.0.2",
2631
"@keystone-ui/fields": "^7.1.2",
2732
"@keystone-ui/loading": "^6.0.2",
2833
"@keystone-ui/notice": "^6.0.2",
34+
"cookie": "^0.5.0",
2935
"cross-fetch": "^3.1.4",
3036
"fast-deep-equal": "^3.1.3",
31-
"graphql": "^16.6.0"
37+
"graphql": "^16.6.0",
38+
"uid-safe": "^2.1.5"
3239
},
3340
"devDependencies": {
3441
"@keystone-6/core": "^3.1.0",
@@ -41,7 +48,8 @@
4148
"preconstruct": {
4249
"entrypoints": [
4350
"index.ts",
44-
"pages/*.tsx"
51+
"pages/*.tsx",
52+
"session/index.ts"
4553
]
4654
},
4755
"repository": "https://github.com/keystonejs/keystone/tree/main/packages/auth"

packages/auth/session/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"main": "dist/keystone-6-auth-session.cjs.js",
3+
"module": "dist/keystone-6-auth-session.esm.js"
4+
}

0 commit comments

Comments
 (0)