Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/gotrue/lib/src/gotrue_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading