module BookingsyncApplication::Controllers::BookingsyncUniverseApiAccess
Private Instance Methods
auth_path()
click to toggle source
# File lib/bookingsync_application/controllers/bookingsync_universe_api_access.rb, line 28 def auth_path "/api/v3/auth" end
authenticate_account!()
click to toggle source
Calls superclass method
# File lib/bookingsync_application/controllers/bookingsync_universe_api_access.rb, line 6 def authenticate_account! if auth = request.headers["Authorization"].presence response = Faraday.new(url: bookingsync_url).get do |req| req.url auth_path req.headers["Authorization"] = auth end if response.success? @scope = AuthorizationScope.from_response(response) session[:account_id] = scope.account_id else render json: response.body, status: response.status and return end else super end end
bookingsync_url()
click to toggle source
# File lib/bookingsync_application/controllers/bookingsync_universe_api_access.rb, line 24 def bookingsync_url "#{ENV['BOOKINGSYNC_URL']}" end
scope()
click to toggle source
# File lib/bookingsync_application/controllers/bookingsync_universe_api_access.rb, line 32 def scope @scope end