Skip to content

Commit

Permalink
logging for Moodle autologin
Browse files Browse the repository at this point in the history
  • Loading branch information
anhefti committed Dec 10, 2024
1 parent eefa6af commit 94cfeef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,10 @@ public boolean autoLogin(final String oneTimeToken) {
final TokenLoginInfo loginInfo = response.getBody();
this.resource.setUsername(loginInfo.username);
this.resource.setPassword(loginInfo.userUUID);
this.restTemplate.getOAuth2ClientContext().setAccessToken(loginInfo.login);

this.restTemplate.getOAuth2ClientContext().setAccessToken(null);
this.restTemplate.getAccessToken();
//this.restTemplate.getOAuth2ClientContext().setAccessToken(loginInfo.login);

loginForward = loginInfo.login_forward;
return this.isLoggedIn();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ public Result<String> getOneTimeTokenForTeacherAccount(
final AdHocAccountData adHocAccountData,
final boolean createIfNotExists) {

// TODO check if Exam is running, if not deny access

return this.userDAO
.byModelId(getTeacherAccountIdentifier(exam, adHocAccountData))
.onErrorDo(error -> handleAccountDoesNotExistYet(createIfNotExists, exam, adHocAccountData))
Expand Down

0 comments on commit 94cfeef

Please sign in to comment.