Klasse AuthCookieService
java.lang.Object
com.spaghetticodegang.trylater.auth.AuthCookieService
Service layer for handling authentication-related cookie operations.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
applyAuthCookie
(jakarta.servlet.http.HttpServletResponse response, String token) Applies the authentication cookie to the given HTTP response.void
clearAuthCookie
(jakarta.servlet.http.HttpServletResponse response) Applies an expired authentication cookie to remove the token on the client.org.springframework.http.ResponseCookie
createAuthCookie
(String token) Creates a secure HTTP-only cookie from the given JWT.org.springframework.http.ResponseCookie
Creates an expired authentication cookie to clear the token from the client.
-
Konstruktordetails
-
AuthCookieService
public AuthCookieService()
-
-
Methodendetails
-
createAuthCookie
Creates a secure HTTP-only cookie from the given JWT.- Parameter:
token
- the JWT used for authentication- Gibt zurück:
- the authentication cookie
-
createExpiredCookie
public org.springframework.http.ResponseCookie createExpiredCookie()Creates an expired authentication cookie to clear the token from the client.- Gibt zurück:
- the expired authentication cookie
-
applyAuthCookie
Applies the authentication cookie to the given HTTP response.- Parameter:
response
- the HTTP servlet responsetoken
- the JWT to include in the cookie
-
clearAuthCookie
public void clearAuthCookie(jakarta.servlet.http.HttpServletResponse response) Applies an expired authentication cookie to remove the token on the client.- Parameter:
response
- the HTTP servlet response
-