mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2026-11-04 09:04:04 +00:00
Initial work towards authentication
This commit is contained in:
@@ -30,6 +30,14 @@ module W3DHubLauncher
|
||||
def self.account
|
||||
end
|
||||
|
||||
def self.user_login(username, password, &block)
|
||||
W3DHubLauncher::Worker::Request.new(:w3dhub_api_call, { call: :user_login, arguments: [username, password] }, &block)
|
||||
end
|
||||
|
||||
def self.refresh_user_login(refresh_token, &block)
|
||||
W3DHubLauncher::Worker::Request.new(:w3dhub_api_call, { call: :refresh_user_login, arguments: [refresh_token] }, &block)
|
||||
end
|
||||
|
||||
# returns launcher settings
|
||||
def self.settings
|
||||
end
|
||||
|
||||
@@ -8,6 +8,8 @@ module W3DHubLauncher
|
||||
|
||||
attr_reader :applications
|
||||
|
||||
attr_writer :access_token
|
||||
|
||||
def initialize
|
||||
@access_token = nil
|
||||
|
||||
@@ -91,8 +93,13 @@ module W3DHubLauncher
|
||||
result
|
||||
end
|
||||
|
||||
def user_login()
|
||||
def user_login(username, password, &block)
|
||||
result = CyberarmEngine::Result.new
|
||||
|
||||
body = URI.encode_www_form("data": JSON.dump({username: username, password: password}))
|
||||
response = fetch("#{PRIMARY_W3DHUB_API_ENDPOINT}/apis/launcher/1/user-login", method: :post, body: body, headers: headers(form_encoded: true))
|
||||
|
||||
pp response
|
||||
end
|
||||
|
||||
def refresh_user_login()
|
||||
|
||||
Reference in New Issue
Block a user