From 0add5e4769adb514e7c042f055665bb709268f5f Mon Sep 17 00:00:00 2001 From: Umberto Sgueglia Date: Thu, 2 Apr 2026 13:49:05 +0200 Subject: [PATCH 1/3] fix: ssoCallback return format Signed-off-by: Umberto Sgueglia --- backend/src/api/auth/ssoCallback.ts | 6 +++--- services/libs/data-access-layer/src/collections/index.ts | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/backend/src/api/auth/ssoCallback.ts b/backend/src/api/auth/ssoCallback.ts index 17caecebe5..e5aeb3119e 100644 --- a/backend/src/api/auth/ssoCallback.ts +++ b/backend/src/api/auth/ssoCallback.ts @@ -29,17 +29,17 @@ export default async (req, res) => { jwt.verify(idToken, getKey, { algorithms: ['RS256'] }, (err, decoded) => { if (err) { req.log.error('Error verifying token', err) - reject(new Error401()) + return reject(new Error401()) } const { aud } = decoded as any if (aud !== AUTH0_CONFIG.clientId) { req.log.error(`Invalid audience: ${aud}`) - reject(new Error401()) + return reject(new Error401()) } - resolve(decoded) + return resolve(decoded) }) }) const data: any = await verifyToken diff --git a/services/libs/data-access-layer/src/collections/index.ts b/services/libs/data-access-layer/src/collections/index.ts index 7921faaa17..f2298bb9cb 100644 --- a/services/libs/data-access-layer/src/collections/index.ts +++ b/services/libs/data-access-layer/src/collections/index.ts @@ -138,13 +138,19 @@ export async function createCollection( qx: QueryExecutor, collection: ICreateCollection, ): Promise { + const data = { + logoUrl: null, + imageUrl: null, + color: null, + ...collection, + } return qx.selectOne( ` INSERT INTO collections (name, description, slug, "categoryId", starred, "logoUrl", "imageUrl", color) VALUES ($(name), $(description), $(slug), $(categoryId), $(starred), $(logoUrl), $(imageUrl), $(color)) RETURNING * `, - collection, + data, ) } From e1b72c9d62bde88c2dd2686137886acf6a4774fd Mon Sep 17 00:00:00 2001 From: Umberto Sgueglia Date: Thu, 2 Apr 2026 17:46:47 +0200 Subject: [PATCH 2/3] fix: remove useless rejects Signed-off-by: Umberto Sgueglia --- backend/src/api/auth/ssoCallback.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/api/auth/ssoCallback.ts b/backend/src/api/auth/ssoCallback.ts index e5aeb3119e..17caecebe5 100644 --- a/backend/src/api/auth/ssoCallback.ts +++ b/backend/src/api/auth/ssoCallback.ts @@ -29,17 +29,17 @@ export default async (req, res) => { jwt.verify(idToken, getKey, { algorithms: ['RS256'] }, (err, decoded) => { if (err) { req.log.error('Error verifying token', err) - return reject(new Error401()) + reject(new Error401()) } const { aud } = decoded as any if (aud !== AUTH0_CONFIG.clientId) { req.log.error(`Invalid audience: ${aud}`) - return reject(new Error401()) + reject(new Error401()) } - return resolve(decoded) + resolve(decoded) }) }) const data: any = await verifyToken From 29fdcd268ba356017ae7a41c94fd1aac027fea98 Mon Sep 17 00:00:00 2001 From: Umberto Sgueglia Date: Thu, 2 Apr 2026 18:02:21 +0200 Subject: [PATCH 3/3] fix: default every field Signed-off-by: Umberto Sgueglia --- services/libs/data-access-layer/src/collections/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/libs/data-access-layer/src/collections/index.ts b/services/libs/data-access-layer/src/collections/index.ts index f2298bb9cb..be5bc75aa9 100644 --- a/services/libs/data-access-layer/src/collections/index.ts +++ b/services/libs/data-access-layer/src/collections/index.ts @@ -139,6 +139,8 @@ export async function createCollection( collection: ICreateCollection, ): Promise { const data = { + description: null, + slug: null, logoUrl: null, imageUrl: null, color: null,