Class: Clerk::Resources::Users

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/clerk/resources/users.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Users

Returns a new instance of Users.



9
10
11
12
# File 'lib/clerk/resources/users.rb', line 9

def initialize(client)
  @client = client
  @resource = PluralResource.new(client, "users")
end

Instance Method Details

#disable_mfa(user_id) ⇒ Object



28
29
30
# File 'lib/clerk/resources/users.rb', line 28

def disable_mfa(user_id)
  @client.request(:delete, "#{@resource.resource_path(user_id)}/mfa")
end

#oauth_access_token(user_id, provider) ⇒ Object



16
17
18
# File 'lib/clerk/resources/users.rb', line 16

def oauth_access_token(user_id, provider)
  @client.request(:get, "#{@resource.resource_path(user_id)}/oauth_access_tokens/#{provider}")
end

#organization_memberships(user_id, query_params = {}) ⇒ Object



32
33
34
# File 'lib/clerk/resources/users.rb', line 32

def organization_memberships(user_id, query_params = {})
  @client.request(:get, "#{@resource.resource_path(user_id)}/organization_memberships", query: query_params)
end

#verify_password(user_id, password) ⇒ Object



20
21
22
# File 'lib/clerk/resources/users.rb', line 20

def verify_password(user_id, password)
  @client.request(:post, "#{@resource.resource_path(user_id)}/verify_password", body: { password: password })
end

#verify_totp(user_id, totp_or_backup_code) ⇒ Object



24
25
26
# File 'lib/clerk/resources/users.rb', line 24

def verify_totp(user_id, totp_or_backup_code)
  @client.request(:post, "#{@resource.resource_path(user_id)}/verify_totp", body: { code: totp_or_backup_code })
end