diff --git a/Gotrue/Client.cs b/Gotrue/Client.cs index 544ceeb..313fae3 100644 --- a/Gotrue/Client.cs +++ b/Gotrue/Client.cs @@ -595,21 +595,13 @@ public async Task SetSession(string accessToken, string refreshToken, b if (CurrentSession == null) return null; - // Check to see if the session has expired. If so go ahead and destroy it. - if (CurrentSession != null && CurrentSession.Expired()) - { - _debugNotification?.Log($"Loaded session has expired"); - DestroySession(); - return null; - } - // If we aren't online, we can't refresh the token if (!Online) { throw new GotrueException("Only supported when online", Offline); } - // We have a session, and hasn't expired, and we seem to be online. Let's try to refresh it. + // We have a session, and we seem to be online. Let's try to refresh it. if (Options.AutoRefreshToken && CurrentSession?.RefreshToken != null) { try @@ -712,9 +704,6 @@ public async Task RefreshToken() if (CurrentSession == null || string.IsNullOrEmpty(CurrentSession?.AccessToken) || string.IsNullOrEmpty(CurrentSession?.RefreshToken)) throw new GotrueException("No current session.", NoSessionFound); - if (CurrentSession!.Expired()) - throw new GotrueException("Session expired", ExpiredRefreshToken); - var result = await _api.RefreshAccessToken(CurrentSession.AccessToken!, CurrentSession.RefreshToken!); if (result == null || string.IsNullOrEmpty(result.AccessToken))