When handling refreshable OAuth2TokenError exceptions, don't try to look up the existing access token in the special case where the token that needs to be refreshed is the Canvas Studio admin user's token, instead of the current user's access token.
This issue caused Canvas Studio assignment launches to fail for users if:
The Canvas Studio admin token needed a refresh
The current user had not directly authorized with Canvas Studio. This primarily means students, since the instructor will authorize with Canvas Studio when they create the assignment.
In this scenario the refresh field was omitted from the response, so users would see a non-working "Authorize Hypothesis" screen, instead of having the frontend initiate an admin user token refresh.
When handling refreshable
OAuth2TokenError
exceptions, don't try to look up the existing access token in the special case where the token that needs to be refreshed is the Canvas Studio admin user's token, instead of the current user's access token.This issue caused Canvas Studio assignment launches to fail for users if:
In this scenario the
refresh
field was omitted from the response, so users would see a non-working "Authorize Hypothesis" screen, instead of having the frontend initiate an admin user token refresh.Fixes https://github.com/hypothesis/support/issues/134