Commit 6aaa7772 by Jan Hrabal

delete user

parent 6fec5f23
...@@ -22,6 +22,7 @@ import org.springframework.security.core.AuthenticationException; ...@@ -22,6 +22,7 @@ import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -223,6 +224,18 @@ public class AuthApiController { ...@@ -223,6 +224,18 @@ public class AuthApiController {
} }
@DeleteMapping("/auth/user")
public ResponseEntity<Void> deleteUser() {
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
// if (auth instanceof AppUserAuthentication) {
// return ((AppUserAuthentication) auth).getUser();
// }
//TODO other auth types?
return ResponseEntity.accepted().build();
}
@GetMapping("/auth/terms") @GetMapping("/auth/terms")
public @ResponseBody LegalDocument terms(Locale locale) { public @ResponseBody LegalDocument terms(Locale locale) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment