lib/smartsheet/endpoints/token/token.rb in smartsheet-2.101.0 vs lib/smartsheet/endpoints/token/token.rb in smartsheet-2.101.1

- old
+ new

@@ -11,13 +11,17 @@ def initialize(client) @client = client end - def build_authorization_url(client_id:, scopes:) + def build_authorization_url(client_id:, scopes:, state: nil) scopes_string = scopes.join('%20') - "https://app.smartsheet.com/b/authorize?response_type=code&client_id=#{client_id}&scope=#{scopes_string}" + url = "https://app.smartsheet.com/b/authorize?response_type=code&client_id=#{client_id}&scope=#{scopes_string}" + if state.present? + return "#{url}&state=#{state}" + end + return url end def get(client_id:, hash:, code:, params: {}, header_overrides: {}) endpoint_spec = Smartsheet::API::EndpointSpec.new( :post, @@ -61,6 +65,6 @@ params: params ) client.make_request(endpoint_spec, request_spec) end end -end \ No newline at end of file +end