You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to handle 400 (invalid_grant, i.e. we deleted the refresh_token to force a logout for some users) and 500 errors from our custom authority server.
However, as it is right now in OAuth2.swift:196, doRefreshToken returns with callback(nil) in these cases and so it will always try show the Login screen (registerClientIfNeeded) instead of allowing me to just show a 'Try later' error.
Another side of this is in OAuth2.swift:358 it will throw an error if there is an invalid_grant, but it will set the refreshToken to nil if there was a 500.
Am I missing something and I should just write my own OAuth2 subclass? In this case I would probably need to override the OAuth2DataLoader as well since right now OAuth2.authorize is final
The text was updated successfully, but these errors were encountered:
There have recently been some changes there, have you seen them? In tryToObtainAccessTokenIfNeeded it will now return the error in the callback (except if it's a 401). This should result in didFail being called in your case, is this not the case?
You're right about the 500 issue in doRefreshToken; happy to review a PR that doesn't delete the token on 500s! :)
I am trying to handle 400 (invalid_grant, i.e. we deleted the refresh_token to force a logout for some users) and 500 errors from our custom authority server.
However, as it is right now in OAuth2.swift:196, doRefreshToken returns with callback(nil) in these cases and so it will always try show the Login screen (registerClientIfNeeded) instead of allowing me to just show a 'Try later' error.
Another side of this is in OAuth2.swift:358 it will throw an error if there is an invalid_grant, but it will set the refreshToken to nil if there was a 500.
Am I missing something and I should just write my own OAuth2 subclass? In this case I would probably need to override the OAuth2DataLoader as well since right now OAuth2.authorize is final
The text was updated successfully, but these errors were encountered: