nordigen / nordigen-php

MIT License
39 stars 16 forks source link

Tokens not being set on the request handler #4

Closed thomasakarlsen closed 2 years ago

thomasakarlsen commented 2 years ago

Describe the bug Currently this package seems to have the ability to store the access and refresh tokens on both the NordigenClient and RequestHandler classes. The functions on the NordigenClient class only set the tokens for itself and not the RequestHandler making it impossible to switch out the tokens, or load them in from cache to avoid re-authenticating unnecessarily. As the RequestHandler instance is private it is impossible to circumvent this.

To Reproduce Steps to reproduce the behavior:

  1. Set access (or refresh) token using the functions on the NordigenClient class
  2. Call any request function

Expected behavior The request is performed successfully

Screenshots N/A

Additional context It seems like there was an intention to store the tokens on the NordigenClient itself, but the way this is all setup now that wont work. I would argue the best solution is to not store the tokens on the NordigenClient, and make the setters and getters proxy to the RequestHandler.

If you're having general trouble with your Nordigen integration or bank related issue, please reach out to our support via email support@nordigen.com