From 673de548125b27fbfda7a6fb492aa3a62e375bc9 Mon Sep 17 00:00:00 2001 From: Anton Backer Date: Tue, 28 Nov 2023 01:00:14 -0800 Subject: [PATCH] fix: Prevent `rw graphiql setup` from breaking with encryptSession error (#9582) Co-authored-by: Daniel Choudhury --- .editorconfig | 2 +- .../cli/src/commands/setup/graphiql/supportedProviders.js | 4 +++- packages/studio/api/lib/authProviderEncoders/dbAuthEncoder.ts | 4 +++- 3 files changed, 7 insertions(+), 3 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..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 { 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()) 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())