class Citadel::Authenticator

Public Instance Methods

get_token(login, password) click to toggle source
# File lib/citadel-ruby-client/authenticator.rb, line 7
def get_token(login, password)
  matrix_paths = MatrixPaths.new
  url = matrix_paths.base_uri + matrix_paths.login_path
  data_hash = { type: 'm.login.password', user: login, password: password }
  data = JSON.generate data_hash
  response = HTTP.post(url, body: data)
  JSON.parse(response.body)['access_token']
end