Skip to content

Please delay requesting an API token until one is needed #709

@ransombriggs

Description

@ransombriggs

Checklist

  • I have looked into the Readme and Examples, and have not found a suitable solution or answer.
  • I have looked into the API documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Describe the problem you'd like to have solved

Whenever a new Auth0::Client is instantiated a synchronous call is made to auth0 to fetch a token. This causes headaches in specs because any time that we instantiate it we have to mock it out with webmock to prevent actual requests. If it were only fetched when required we could focus our mocks to just the areas of code that require it rather than anything that happens to trigger an object instantiation.

Describe the ideal solution

When I do Auth0::Client.new there are zero network requests made.

Alternatives and current workarounds

We are considering putting a global mock in for this which we are not happy with.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestA feature has been asked for or suggested by the community

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions