Skip to content

Commit

Permalink
Merge pull request #48 from lowdefy/mongodb-adapter-removed-user
Browse files Browse the repository at this point in the history
Add support for a removed field on the user object.
  • Loading branch information
Gervwyk authored Jul 19, 2024
2 parents 8b9416d + dd8f667 commit 3aee482
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/fair-turkeys-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lowdefy/community-plugin-mongodb': minor
---

Add support for a removed field on the user object.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async function createDatabaseUserFromContact({
throw new Error('Access denied.');
}

if (contact.disabled || contact.apps?.[appName]?.disabled) {
if (contact.disabled || contact.removed || contact.apps?.[appName]?.disabled) {
throw new Error('Access denied.');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ async function getUserFromDbByEmail({ appName, collectionNames, email, mongoClie
if (
!contact ||
contact.disabled ||
contact.removed ||
!contact.apps?.[appName]?.is_user ||
contact.apps?.[appName]?.disabled
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ async function getUserFromDbById({ appName, collectionNames, mongoClient, userId
if (
!contact ||
contact.disabled ||
contact.removed ||
!contact.apps?.[appName]?.is_user ||
contact.apps?.[appName]?.disabled
) {
Expand Down

0 comments on commit 3aee482

Please sign in to comment.