Merge branch 'dev-1.3' into SEBSERV-308

This commit is contained in:
anhefti 2022-05-18 10:34:18 +02:00
commit 9416ffbb5b

View file

@ -55,7 +55,8 @@ public class OlatLmsRestTemplate extends RestTemplate {
ClientHttpResponse response = execution.execute(request, body);
log.debug("OLAT [regular API call] {} Headers: {}", response.getStatusCode(), response.getHeaders());
// If we get a 401, re-authenticate and try once more
if (response.getStatusCode() == HttpStatus.UNAUTHORIZED) {
if (response.getStatusCode() == HttpStatus.UNAUTHORIZED ||
response.getStatusCode() == HttpStatus.FORBIDDEN) {
authenticate();
request.getHeaders().set("X-OLAT-TOKEN", OlatLmsRestTemplate.this.token);
response = execution.execute(request, body);