SEBSERV-467 fixed only authenticate on testing if no token

This commit is contained in:
anhefti 2023-10-02 17:02:41 +02:00
parent ac8c7b034d
commit 51033385fd

View file

@ -33,7 +33,9 @@ public class OlatLmsRestTemplate extends RestTemplate {
private ClientCredentialsResourceDetails details;
public void testAuthentication() {
authenticate();
if (this.token == null) {
authenticate();
}
}
public OlatLmsRestTemplate(final ClientCredentialsResourceDetails details) {
@ -49,6 +51,7 @@ public class OlatLmsRestTemplate extends RestTemplate {
final ClientHttpRequestExecution execution) throws IOException {
try {
// if there's no token, authenticate first
if (OlatLmsRestTemplate.this.token == null) {
authenticate();