lib/rdstation/authentication.rb in rdstation-ruby-client-2.5.1 vs lib/rdstation/authentication.rb in rdstation-ruby-client-2.5.2
- old
+ new
@@ -1,13 +1,13 @@
# encoding: utf-8
module RDStation
class Authentication
include HTTParty
- AUTH_TOKEN_URL = 'https://api.rd.services/auth/token'.freeze
+ AUTH_TOKEN_URL = "#{RDStation.host}/auth/token".freeze
DEFAULT_HEADERS = { 'Content-Type' => 'application/json' }.freeze
- REVOKE_URL = 'https://api.rd.services/auth/revoke'.freeze
+ REVOKE_URL = "#{RDStation.host}/auth/revoke".freeze
def initialize(client_id = nil, client_secret = nil)
warn_deprecation if client_id || client_secret
@client_id = client_id || RDStation.configuration&.client_id
@client_secret = client_secret || RDStation.configuration&.client_secret
@@ -17,10 +17,10 @@
# param redirect_url
# URL that the user will be redirected
# after confirming application authorization
#
def auth_url(redirect_url)
- "https://api.rd.services/auth/dialog?client_id=#{@client_id}&redirect_url=#{redirect_url}"
+ "#{RDStation.host}/auth/dialog?client_id=#{@client_id}&redirect_url=#{redirect_url}"
end
# Public: Get the credentials from RD Station API
#
# code - The code String sent by RDStation after the user confirms authorization.