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

fix: access token doesn't generate errors when token expires #45

Merged
merged 3 commits into from
Oct 10, 2023

Conversation

julianramirez2
Copy link
Contributor

Description

There was a bug that caused an error when you tried to make, for the first time after a while, a new request. This request showed something like 'error getting user' and it was not a problem with the get_user function, it was a problem with the access token. The creation of a new token returns an array containing the 'success' message and the token generated by the API but, when the token is available, it returns only the token value because the process sends a request to the WP database. For that, a check for the access token response was added: when the response is an array it takes the value of the token from the array, when it isn't, it continues the process as always.

Testing instructions

You can test it by changing the expiration time of the access token and attempting to create a new request after the token has already expired.

Checklist for Merge

  • Tested in a remote environment
  • Updated documentation
  • Rebased master/main
  • Squashed commits

@julianramirez2
Copy link
Contributor Author

@MaferMazu @andres-arango-aptitude can you check this, please?

@julianramirez2 julianramirez2 merged commit 594cd31 into main Oct 10, 2023
3 checks passed
@felipemontoya felipemontoya deleted the error-new-enrollment branch March 21, 2024 17:32
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

Successfully merging this pull request may close these issues.

2 participants