# frozen_string_literal: true module ApiController # General barong API functions class Barong require 'json' require 'rest-client' def initialize(endpoint, app_id) @endpoint = endpoint @app_id = app_id end def log_in(email, password) response = RestClient.post("#{@endpoint}/sessions", { 'email': email, 'password': password, 'application_id': @app_id, 'expires_in': 80_000 }, { 'content_type': 'application/x-www-form-urlencoded' }) response.delete('"') end end end