Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore expired & revoked tokens in SSOPushCredential.credentials
Trello: https://trello.com/c/piKwrxYP Previously when a token reached its (10 year) expiry, the code in SSOPushCredential.credentials was still finding the expired token and trying to use it in the SSOPushClient, but triggering a SSOPushError exception due to an invalid bearer token. While we were debugging this also realised that SSOPushCredential.credentials was also finding revoked tokens, thus making it impossible to resolve the situation from the Signon UI. Now we ignore both expired & revoked tokens when deciding whether we already have a valid token or that we need to create one. Note that the `Doorkeeper::AccessToken.not_expired` scope [1] seems to helpfully exclude both expired *and* revoked tokens. [1]: https://github.com/doorkeeper-gem/doorkeeper/blob/986115cc228ff30dc1ead0f4101195448994f5d4/lib/doorkeeper/orm/active_record/mixins/access_token.rb#L47-L66
- Loading branch information