Class: LearnWorlds::SingleSignOnResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/learn_worlds/resources/single_sign_on_resource.rb

Constant Summary collapse

SSO_ENDPOINT =
"/admin/api/sso".freeze

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#default_headers, #delete_request, #get_request, #handle_errors, #handle_response, #initialize, #patch_request, #post_request, #put_request

Constructor Details

This class inherits a constructor from LearnWorlds::Resource

Instance Method Details

#redirect(email:, redirect_to:) ⇒ Object



5
6
7
# File 'lib/learn_worlds/resources/single_sign_on_resource.rb', line 5

def redirect(email:, redirect_to:)
  post_request(SSO_ENDPOINT, { email: email, redirectUrl: redirect_to }).body['url']
end

#redirect_with_id(user_id:, redirect_to:) ⇒ Object



9
10
11
# File 'lib/learn_worlds/resources/single_sign_on_resource.rb', line 9

def redirect_with_id(user_id:, redirect_to:)
  post_request(SSO_ENDPOINT, { user_id: user_id, redirectUrl: redirect_to }).body['url']
end