attemptRefreshingSession static method
Implementation
static Future<bool> attemptRefreshingSession() async {
LocalSessionState preRequestLocalSessionState =
await SuperTokensUtils.getLocalSessionState();
bool shouldRetry = false;
Exception? exception;
dynamic resp =
await Client.onUnauthorisedResponse(preRequestLocalSessionState);
if (resp is UnauthorisedResponse) {
if (resp.status == UnauthorisedStatus.API_ERROR) {
exception = resp.error as SuperTokensException;
} else {
shouldRetry = resp.status == UnauthorisedStatus.RETRY;
}
}
if (exception != null) {
throw exception;
}
return shouldRetry;
}