From abbcb6bf5c6cce5fbfe383a43c10c4587e7e8bfc Mon Sep 17 00:00:00 2001 From: siujamo Date: Thu, 12 Mar 2026 15:37:51 +0800 Subject: [PATCH] feat: enhance cookie creation method with detailed documentation --- .../com/onixbyte/helix/service/AuthService.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/onixbyte/helix/service/AuthService.java b/src/main/java/com/onixbyte/helix/service/AuthService.java index 82ea596..d7304c8 100644 --- a/src/main/java/com/onixbyte/helix/service/AuthService.java +++ b/src/main/java/com/onixbyte/helix/service/AuthService.java @@ -105,10 +105,22 @@ public class AuthService { .build(); } - protected ResponseCookie.ResponseCookieBuilder buildCookieInternal(String cookieName, String value, Duration validDuration) { + /** + * Creates a response cookie builder with specified name, value and valid duration. + * + * @param name name of the cookie + * @param value value of the cookie + * @param validDuration valid duration of the cookie + * @return cookie builder + */ + protected ResponseCookie.ResponseCookieBuilder buildCookieInternal( + String name, + String value, + Duration validDuration + ) { var applicationMode = applicationManager.getApplicationMode(); - var cookieBuilder = ResponseCookie.from(cookieName, value) + var cookieBuilder = ResponseCookie.from(name, value) .maxAge(securityManager.getTokenValidDuration()) .secure(true) .maxAge(validDuration)