Skip to content

Commit

Permalink
Fix role assignment for invited users
Browse files Browse the repository at this point in the history
  • Loading branch information
kcoderhtml committed Apr 20, 2024
1 parent 7241bac commit 6a9bf28
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions auth.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ export default defineConfig({
} else {
role[0] = { role: "guest" };
}
} else if (role[0].role === "invited") {
role[0] = { role: "user" };

await db
.update(User)
.set({
role: "user",
})
.where(like(User.userId, profile["https://slack.com/user_id"]));
}

return {
Expand Down

0 comments on commit 6a9bf28

Please sign in to comment.