onUnauthorized method

Future<bool> onUnauthorized()

Called once when a request returns 401.

Return true if a token was refreshed and the request should be retried once. The default returns false, preserving pre-0.9 behaviour.

Implementations must not call back into a request that can itself 401, or the guard below will deadlock waiting on its own future.

Implementation

Future<bool> onUnauthorized() async => false;