All Downloads are FREE. Search and download functionalities are using the official Maven repository.

br.com.jhonsapp.bootstrap.object.resource.UserResource Maven / Gradle / Ivy

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());
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy