Assume tokens with expiry have always expired (#4644)

This commit is contained in:
Nidhi 2021-05-24 16:35:32 +05:30 committed by GitHub
parent df03570a4f
commit 49c489dac0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,6 +86,11 @@ public class OAuth2 extends AuthenticationDTO {
"Expected datasource to have valid authentication tokens at this point"));
}
if (this.authenticationResponse.expiresAt == null) {
// If the token did not return with an expiry time, assume that it has always expired
return Mono.just(Boolean.TRUE);
}
return Mono.just(authenticationResponse.expiresAt.isBefore(Instant.now().plusSeconds(60)));
}
}