Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xero_client.token_expired? #248

Open
helmiattastify opened this issue Feb 16, 2023 · 3 comments
Open

xero_client.token_expired? #248

helmiattastify opened this issue Feb 16, 2023 · 3 comments
Assignees

Comments

@helmiattastify
Copy link

I got an error when

 credentials = {
        client_id: ENV['XERO_CLIENT_ID'],
        client_secret: ENV['XERO_CLIENT_SECRET'],
        grant_type: 'client_credentials'
      }

      @client ||= XeroRuby::ApiClient.new(credentials: credentials)
      @client.token_expired? 

*** NoMethodError Exception: undefined method `count' for nil:NilClass

but I don't get an error if I pull the token

@client.get_client_credentials_token

before @client.token_expired? 
@github-actions
Copy link

PETOSS-270

@github-actions
Copy link

Thanks for raising an issue, a ticket has been created to track your request

@pumpkinball
Copy link
Contributor

Hi @helmiattastify thanks for this. Yes running ApiClient.new(credentials: credentials) generates the token, and to collect the token, you do need to run get_client_credentials_token. Once you have it, you can check the expiry on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants