Skip to content

Commit

Permalink
SEBSERV-417 fix autologin
Browse files Browse the repository at this point in the history
  • Loading branch information
anhefti committed Jun 19, 2024
1 parent 1a5bb6f commit a31e001
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ public void commence(
.getBean(AuthorizationContextHolder.class);
final SEBServerAuthorizationContext authorizationContext = authorizationContextHolder
.getAuthorizationContext(request.getSession());

// check first if we already have an active session if so, invalidate ir
if (authorizationContext.isLoggedIn()) {
authorizationContext.logout();
}

if (authorizationContext.autoLogin(jwt)) {
forwardToEntryPoint(request, response, this.guiEntryPoint, true);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,6 @@ public boolean login(final String username, final CharSequence password) {
@Override
public boolean autoLogin(final String oneTimeToken) {
try {
// check first if we already have an active session if so, invalidate ir
if (this.isLoggedIn()) {
this.logout();
}

// Create ad-hoc RestTemplate and call token verification
final RestTemplate verifyTemplate = new RestTemplate(this.clientHttpRequestFactory);
Expand Down

0 comments on commit a31e001

Please sign in to comment.