add log out
This commit is contained in:
parent
4b2787344a
commit
06eb2e8b12
@ -49,6 +49,7 @@ public class SecurityConfig {
|
|||||||
return http.csrf(AbstractHttpConfigurer::disable)
|
return http.csrf(AbstractHttpConfigurer::disable)
|
||||||
.authorizeHttpRequests(auth -> auth.requestMatchers(new AntPathRequestMatcher("/api/auth")).permitAll()
|
.authorizeHttpRequests(auth -> auth.requestMatchers(new AntPathRequestMatcher("/api/auth")).permitAll()
|
||||||
.anyRequest().authenticated())
|
.anyRequest().authenticated())
|
||||||
|
.logout((logout) -> logout.logoutUrl("/api/logout"))
|
||||||
.httpBasic(Customizer.withDefaults())
|
.httpBasic(Customizer.withDefaults())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,11 @@ public class EmployeeController {
|
|||||||
private final EmployeeService employeeService;
|
private final EmployeeService employeeService;
|
||||||
|
|
||||||
@GetMapping("/auth")
|
@GetMapping("/auth")
|
||||||
public void EmployeeExists(@RequestParam final String login) {
|
public void authEmployee(@RequestParam final String login) {
|
||||||
|
employeeService.employeeExists(login);
|
||||||
|
}
|
||||||
|
@GetMapping("/logout")
|
||||||
|
public void logoutEmployee(@RequestParam final String login) {
|
||||||
employeeService.employeeExists(login);
|
employeeService.employeeExists(login);
|
||||||
}
|
}
|
||||||
@GetMapping("/info")
|
@GetMapping("/info")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user