Add all optional params to create_user/2 and update_user/3#77
Merged
hexedpackets merged 1 commit intomainfrom Dec 31, 2025
Merged
Add all optional params to create_user/2 and update_user/3#77hexedpackets merged 1 commit intomainfrom
create_user/2 and update_user/3#77hexedpackets merged 1 commit intomainfrom
Conversation
Greptile SummaryThis PR fixes two bugs in the UserManagement module and adds missing API parameters.
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Caller
participant UserManagement
participant Client
participant WorkOS API
Note over Caller,WorkOS API: create_user flow (fixed)
Caller->>UserManagement: create_user(%{email: "user@example.com", password: "secret"})
UserManagement->>UserManagement: Map.take(opts, [:email, :password, ...])
UserManagement->>Client: post("/user_management/users", %{email: "...", password: "..."})
Client->>WorkOS API: POST with JSON body (only provided fields)
WorkOS API-->>Caller: User created with password set
Note over Caller,WorkOS API: update_user flow (fixed)
Caller->>UserManagement: update_user(user_id, %{password: "newpass"})
UserManagement->>UserManagement: Map.take(opts, [:password, :email_verified, ...])
Note right of UserManagement: Only password included (email_verified omitted)
UserManagement->>Client: put("/user_management/users/:id", %{password: "..."})
Client->>WorkOS API: PUT with JSON body (only provided fields)
WorkOS API-->>Caller: User updated without changing email_verified
|
cmatheson
approved these changes
Dec 31, 2025
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds all missing optional parameters for these methods. Using
Map.take/2instead of explicitly listing the new map also fixes an issue whereemail_verifiedwas always being sent to the API regardless of whether the caller passes it.Closes #76