extract to meanful method
Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>
This commit is contained in:
@@ -573,14 +573,16 @@ class AuthenticationSuccessTenantMetadataCreationFilter implements Filter {
|
|||||||
@Override
|
@Override
|
||||||
public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)
|
public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)
|
||||||
throws IOException, ServletException {
|
throws IOException, ServletException {
|
||||||
|
lazyCreateTenantMetadata();
|
||||||
|
chain.doFilter(request, response);
|
||||||
|
|
||||||
// lazy initialize tenant meta data after successful authentication
|
}
|
||||||
|
|
||||||
|
private void lazyCreateTenantMetadata() {
|
||||||
final Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
final Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||||
if (authentication != null && authentication.isAuthenticated()) {
|
if (authentication != null && authentication.isAuthenticated()) {
|
||||||
systemSecurityContext.runAsSystem(() -> systemManagement.getTenantMetadata());
|
systemSecurityContext.runAsSystem(() -> systemManagement.getTenantMetadata());
|
||||||
}
|
}
|
||||||
chain.doFilter(request, response);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user