Browse Source

add back in attribute writer

master
Richard Cagle 1 year ago
parent
commit
4ff9d0f612
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      basecamp3.rb

+ 2
- 2
basecamp3.rb View File

@@ -3,7 +3,7 @@
require "oauth2"

class Basecamp3
attr_accessor :client, :api_url, :auth_info, :authorize_url, :request_count, :request_start
attr_accessor :client, :api_url, :auth_info, :authorize_url, :request_count, :request_start, :ouath_token

def initialize
@client = OAuth2::Client.new(
@@ -16,7 +16,7 @@ class Basecamp3

@authorize_url = @client.auth_code.authorize_url(redirect_uri: ENV["REDIRECT_URL"], type: "web_server")

unless token
if token
token_record = token
@ouath_token = OAuth2::AccessToken.from_hash(@client, token_record.oauth_hash)
@ouath_token = @ouath_token.refresh if @ouath_token.expired?

Loading…
Cancel
Save