Skip to content

Commit

Permalink
throw error again after interception
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonEntholzer committed Feb 25, 2025
1 parent 89c9b92 commit 121de51
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Profile;
import org.springframework.http.HttpStatus;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.AuthenticationException;
Expand Down Expand Up @@ -264,7 +263,7 @@ public void authenticateAndAuthorizeGitRequest(HttpServletRequest request, Repos
catch (LocalVCForbiddenException e) {
log.error("User {} does not have access to the repository {}", user.getLogin(), localVCRepositoryUri);
saveFailedAccessVcsAccessLog(Optional.of(request), Optional.empty(), repositoryTypeOrUserName, exercise, localVCRepositoryUri, user, repositoryAction);
throw new AccessDeniedException("User does not have access to this repository", e);
throw e;
}

log.debug("Authorizing user {} for repository {} took {}", user.getLogin(), localVCRepositoryUri, TimeLogUtil.formatDurationFrom(timeNanoStart));
Expand Down

0 comments on commit 121de51

Please sign in to comment.