Skip to content

Commit c9f0b0a

Browse files
committed
Check for userId when saving user
1 parent a13169b commit c9f0b0a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ app.post('/', (req, res) => {
3939

4040
const { access } = getIAMRights(relevantIamGroups)
4141

42-
User.upsert({ id: userId, iamGroups: relevantIamGroups })
42+
if (userId && iamGroups)
43+
User.upsert({ id: userId, iamGroups: relevantIamGroups })
4344

4445
if (Object.keys(access).length !== 0)
4546
logger.info('IAM authentication', { userId, iamGroups, access })

0 commit comments

Comments
 (0)