File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -192,10 +192,19 @@ export async function getToken(
192192 // count this as a failed attempt and use the backoff instead of
193193 // retrying repeatedly with no delay, but any 3P listeners will not
194194 // be hindered in getting the still-valid token.
195- interopTokenResult = {
196- token : token . token ,
197- internalError : error
198- } ;
195+ if ( forceRefresh ) {
196+ // If forceRefresh is true, return the error alongside the token
197+ // to propagate the failure properly.
198+ interopTokenResult = {
199+ token : token . token ,
200+ error
201+ } ;
202+ } else {
203+ interopTokenResult = {
204+ token : token . token ,
205+ internalError : error
206+ } ;
207+ }
199208 } else {
200209 // No invalid tokens should make it to this step. Memory and cached tokens
201210 // are checked. Other tokens are from fresh exchanges. But just in case.
You can’t perform that action at this time.
0 commit comments