Skip to content

Commit 5103338

Browse files
committed
SEBSERV-467 fixed only authenticate on testing if no token
1 parent ac8c7b0 commit 5103338

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/olat/OlatLmsRestTemplate.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ public class OlatLmsRestTemplate extends RestTemplate {
3333
private ClientCredentialsResourceDetails details;
3434

3535
public void testAuthentication() {
36-
authenticate();
36+
if (this.token == null) {
37+
authenticate();
38+
}
3739
}
3840

3941
public OlatLmsRestTemplate(final ClientCredentialsResourceDetails details) {
@@ -49,6 +51,7 @@ public synchronized ClientHttpResponse intercept(
4951
final ClientHttpRequestExecution execution) throws IOException {
5052

5153
try {
54+
5255
// if there's no token, authenticate first
5356
if (OlatLmsRestTemplate.this.token == null) {
5457
authenticate();

0 commit comments

Comments
 (0)