onLogoutSuccess(HttpServletRequest,HttpServletResponse,Authentication)   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 9
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
dl 0
loc 9
rs 9.95
c 1
b 0
f 0
cc 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