com.osomapps.pt.config.CustomLogoutSuccessHandler   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 11
dl 0
loc 12
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A onLogoutSuccess(HttpServletRequest,HttpServletResponse,Authentication) 0 9 1
1
package com.osomapps.pt.config;
2
3
import java.io.IOException;
4
import javax.servlet.ServletException;
5
import javax.servlet.http.HttpServletRequest;
6
import javax.servlet.http.HttpServletResponse;
7
import org.springframework.security.core.Authentication;
8
import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
9
import org.springframework.stereotype.Component;
10
11
@Component
12
class CustomLogoutSuccessHandler implements LogoutSuccessHandler {
13
14
    @Override
15
    public void onLogoutSuccess(
16
            HttpServletRequest request,
17
            HttpServletResponse httpServletResponse,
18
            Authentication authentication)
19
            throws IOException, ServletException {
20
        httpServletResponse.setContentType("application/json;charset=UTF-8");
21
        httpServletResponse.getWriter().format("{\"authenticated\": \"false\"}");
0 ignored issues
show
Comprehensibility Code Smell introduced by
String contains no format specifiers.
Loading history...
22
        httpServletResponse.setStatus(HttpServletResponse.SC_OK);
23
    }
24
}
25