diff --git a/.changeset/session-went-far.md b/.changeset/session-went-far.md new file mode 100644 index 00000000000..e38b31b7630 --- /dev/null +++ b/.changeset/session-went-far.md @@ -0,0 +1,5 @@ +--- +'@keystone-6/core': patch +--- + +Fixes regression from #8073, `.sudo` now retains the `context.session` diff --git a/packages/core/src/lib/context/createContext.ts b/packages/core/src/lib/context/createContext.ts index ff6c8dde78c..8c37dd0b4f7 100644 --- a/packages/core/src/lib/context/createContext.ts +++ b/packages/core/src/lib/context/createContext.ts @@ -91,8 +91,8 @@ export function createContext({ graphql: { raw: rawGraphQL, run: runGraphQL, schema }, prisma: prismaClient, - sudo: () => construct({ sudo: true, req, res }), - exitSudo: () => construct({ sudo: false, req, res }), // TODO: remove, deprecated + sudo: () => construct({ session, sudo: true, req, res }), + exitSudo: () => construct({ session, sudo: false, req, res }), // TODO: remove, deprecated req, res,