br.com.jhonsapp.bootstrap.object.resource.UserResource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bootstrap-object Show documentation
Show all versions of bootstrap-object Show documentation
A complete architecture for creating and managing users.
The newest version!
package br.com.jhonsapp.bootstrap.object.resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import br.com.jhonsapp.bootstrap.object.util.RefreshTokenUtil;
@RestController
@RequestMapping("/users")
public class UserResource {
@Autowired
private RefreshTokenUtil refreshTokenUtil;
@DeleteMapping("/logout")
public void revoke(HttpServletRequest req, HttpServletResponse resp) {
refreshTokenUtil.invalidateRefreshTokenCookie(req, resp);
resp.setStatus(HttpStatus.NO_CONTENT.value());
}
}