diff --git a/packages/gotrue/lib/src/gotrue_client.dart b/packages/gotrue/lib/src/gotrue_client.dart index b5650c4c1..13d5d218c 100644 --- a/packages/gotrue/lib/src/gotrue_client.dart +++ b/packages/gotrue/lib/src/gotrue_client.dart @@ -777,7 +777,8 @@ class GoTrueClient { // Throws AuthInvalidJwtException if the token is malformed. final decoded = decodeJwt(accessToken); final exp = decoded.payload.exp; - final hasExpired = exp == null || exp <= timeNow; + final hasExpired = + exp == null || exp <= timeNow + Constants.expiryMargin.inSeconds; if (hasExpired) { return await _callRefreshToken(refreshToken);