Skip to content

Commit 0add5e4

Browse files
committed
fix: ssoCallback return format
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
1 parent 7cdafa5 commit 0add5e4

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

backend/src/api/auth/ssoCallback.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@ export default async (req, res) => {
2929
jwt.verify(idToken, getKey, { algorithms: ['RS256'] }, (err, decoded) => {
3030
if (err) {
3131
req.log.error('Error verifying token', err)
32-
reject(new Error401())
32+
return reject(new Error401())
3333
}
3434

3535
const { aud } = decoded as any
3636

3737
if (aud !== AUTH0_CONFIG.clientId) {
3838
req.log.error(`Invalid audience: ${aud}`)
39-
reject(new Error401())
39+
return reject(new Error401())
4040
}
4141

42-
resolve(decoded)
42+
return resolve(decoded)
4343
})
4444
})
4545
const data: any = await verifyToken

services/libs/data-access-layer/src/collections/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,19 @@ export async function createCollection(
138138
qx: QueryExecutor,
139139
collection: ICreateCollection,
140140
): Promise<ICollection> {
141+
const data = {
142+
logoUrl: null,
143+
imageUrl: null,
144+
color: null,
145+
...collection,
146+
}
141147
return qx.selectOne(
142148
`
143149
INSERT INTO collections (name, description, slug, "categoryId", starred, "logoUrl", "imageUrl", color)
144150
VALUES ($(name), $(description), $(slug), $(categoryId), $(starred), $(logoUrl), $(imageUrl), $(color))
145151
RETURNING *
146152
`,
147-
collection,
153+
data,
148154
)
149155
}
150156

0 commit comments

Comments
 (0)