27 lines
579 B
Java
27 lines
579 B
Java
package com.drinkool.controller;
|
|
|
|
import com.drinkool.InternalValue;
|
|
import com.drinkool.Url;
|
|
import jakarta.ws.rs.POST;
|
|
import jakarta.ws.rs.Path;
|
|
import jakarta.ws.rs.core.NewCookie;
|
|
import org.jboss.resteasy.reactive.RestResponse;
|
|
|
|
public abstract class BaseController {
|
|
|
|
@POST
|
|
@Path(Url.Logout)
|
|
public RestResponse<Void> logout() {
|
|
NewCookie cookie = new NewCookie.Builder(InternalValue.cookieName)
|
|
.secure(true)
|
|
.maxAge(0)
|
|
.path("/")
|
|
.httpOnly(true)
|
|
.build();
|
|
|
|
return RestResponse.ResponseBuilder.<Void>noContent()
|
|
.cookie(cookie)
|
|
.build();
|
|
}
|
|
}
|