Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/workos/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class User
include HashProvider

attr_accessor :id, :email, :first_name, :last_name, :email_verified,
:profile_picture_url, :last_sign_in_at, :created_at, :updated_at
:profile_picture_url, :external_id, :last_sign_in_at, :created_at, :updated_at

def initialize(json)
hash = JSON.parse(json, symbolize_names: true)
Expand All @@ -19,6 +19,7 @@ def initialize(json)
@last_name = hash[:last_name]
@email_verified = hash[:email_verified]
@profile_picture_url = hash[:profile_picture_url]
@external_id = hash[:external_id]
@last_sign_in_at = hash[:last_sign_in_at]
@created_at = hash[:created_at]
@updated_at = hash[:updated_at]
Expand All @@ -32,6 +33,7 @@ def to_json(*)
last_name: last_name,
email_verified: email_verified,
profile_picture_url: profile_picture_url,
external_id: external_id,
last_sign_in_at: last_sign_in_at,
created_at: created_at,
updated_at: updated_at,
Expand Down
3 changes: 3 additions & 0 deletions lib/workos/user_management.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ def create_user(
# @param [String] first_name The user's first name.
# @param [String] last_name The user's last name.
# @param [Boolean] email_verified Whether the user's email address was previously verified.
# @param [String] external_id The users's external ID
# @param [String] password The user's password.
# @param [String] password_hash The user's hashed password.
# @option [String] password_hash_type The algorithm originally used to hash the password.
Expand All @@ -231,6 +232,7 @@ def update_user(
first_name: nil,
last_name: nil,
email_verified: nil,
external_id: nil,
password: nil,
password_hash: nil,
password_hash_type: nil
Expand All @@ -242,6 +244,7 @@ def update_user(
first_name: first_name,
last_name: last_name,
email_verified: email_verified,
external_id: external_id,
password: password,
password_hash: password_hash,
password_hash_type: password_hash_type,
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/workos/user_management_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,12 @@
first_name: 'Jane',
last_name: 'Doe',
email_verified: false,
external_id: '123',
)
expect(user.first_name).to eq('Jane')
expect(user.last_name).to eq('Doe')
expect(user.email_verified).to eq(false)
expect(user.external_id).to eq('123')
end
end

Expand Down
Loading