Skip to content

Commit

Permalink
fix(api_client): fixes issue with token not renewing (CrowdStrike#37)
Browse files Browse the repository at this point in the history
Fixes CrowdStrike#34

Adds a better debug message and now updated the config.access_token attr
  • Loading branch information
carlosmmatos authored Oct 31, 2024
1 parent 762acca commit ce3d7fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/crimson-falcon/api_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ def self.default
# the data deserialized from response body (could be nil), response status code and response headers.
def call_api(http_method, path, opts = {})
# Debug access_token expiration
@config.logger.debug "ACCESS TOKEN EXPIRED" if access_token_expired?
get_access_token if @config.access_token.nil? || access_token_expired?
@config.logger.debug "Access token expired. Initiating refresh..." if access_token_expired?
@config.access_token = get_access_token if @config.access_token.nil? || access_token_expired?
request = build_request(http_method, path, opts)
response = request.run

Expand Down

0 comments on commit ce3d7fe

Please sign in to comment.