From 665d9366d7b54d6612931e9fea95a4ab7ee28cca Mon Sep 17 00:00:00 2001 From: Anton Backer Date: Mon, 27 Nov 2023 20:50:27 -0800 Subject: [PATCH 1/3] fix: graphiql setup doesn't break on encryptSession --- .editorconfig | 2 +- packages/cli/src/commands/setup/graphiql/supportedProviders.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.editorconfig b/.editorconfig index 871c2f2fb484..d60b940abe37 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,7 +7,7 @@ root = true [*] end_of_line = lf insert_final_newline = true -charset = utf8 +charset = utf-8 [*.{js,jsx,ts,tsx,graphql,sql,md,html,mjml,json,jsonc,json5,yml,yaml,template,sh,Dockerfile}] indent_style = space diff --git a/packages/cli/src/commands/setup/graphiql/supportedProviders.js b/packages/cli/src/commands/setup/graphiql/supportedProviders.js index fdb50cafa9b5..4ceabd3b9046 100644 --- a/packages/cli/src/commands/setup/graphiql/supportedProviders.js +++ b/packages/cli/src/commands/setup/graphiql/supportedProviders.js @@ -20,7 +20,7 @@ const getDBAuthHeader = async (userId) => { ) } - const { encryptSession } = await import('@redwoodjs/auth-dbauth-api') + const { default: { encryptSession } } = await import('@redwoodjs/auth-dbauth-api') const id = isNumeric(userId) ? parseInt(userId) : userId const cookie = encryptSession(JSON.stringify({ id }) + ';' + uuidv4()) From eaeeb213ec7c3d2811996ca8d787c1e97257c9d4 Mon Sep 17 00:00:00 2001 From: Anton Backer Date: Mon, 27 Nov 2023 21:12:59 -0800 Subject: [PATCH 2/3] Lint fix --- .../cli/src/commands/setup/graphiql/supportedProviders.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/commands/setup/graphiql/supportedProviders.js b/packages/cli/src/commands/setup/graphiql/supportedProviders.js index 4ceabd3b9046..f51fca9e8a3e 100644 --- a/packages/cli/src/commands/setup/graphiql/supportedProviders.js +++ b/packages/cli/src/commands/setup/graphiql/supportedProviders.js @@ -20,7 +20,9 @@ const getDBAuthHeader = async (userId) => { ) } - const { default: { encryptSession } } = await import('@redwoodjs/auth-dbauth-api') + const { + default: { encryptSession }, + } = await import('@redwoodjs/auth-dbauth-api') const id = isNumeric(userId) ? parseInt(userId) : userId const cookie = encryptSession(JSON.stringify({ id }) + ';' + uuidv4()) From 56b637b567cd421afcbc753b2e648e3c0a0d01a8 Mon Sep 17 00:00:00 2001 From: Daniel Choudhury Date: Tue, 28 Nov 2023 15:19:02 +0700 Subject: [PATCH 3/3] Apply change for studio auth encoder too --- packages/studio/api/lib/authProviderEncoders/dbAuthEncoder.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/studio/api/lib/authProviderEncoders/dbAuthEncoder.ts b/packages/studio/api/lib/authProviderEncoders/dbAuthEncoder.ts index 771fefca29a1..653ea878864a 100644 --- a/packages/studio/api/lib/authProviderEncoders/dbAuthEncoder.ts +++ b/packages/studio/api/lib/authProviderEncoders/dbAuthEncoder.ts @@ -17,7 +17,9 @@ export const getDBAuthHeader = async (userId?: string) => { ) } - const { encryptSession } = await import('@redwoodjs/auth-dbauth-api') + const { + default: { encryptSession }, + } = await import('@redwoodjs/auth-dbauth-api') const id = isNumeric(userId) ? parseInt(userId) : userId const cookie = encryptSession(JSON.stringify({ id }) + ';' + uuidv4())