fix: ensure access and refresh cookie values are strings before assignment

This commit is contained in:
monoid 2025-10-01 01:40:35 +09:00
parent 7f829b32d4
commit cb6d03458f

View file

@ -127,8 +127,8 @@ async function authenticate(
const secretKey = setting.jwt_secretkey;
const accessCookie = cookie[accessTokenName];
const refreshCookie = cookie[refreshTokenName];
const accessValue = accessCookie?.value;
const refreshValue = refreshCookie?.value;
const accessValue = typeof accessCookie?.value === 'string' ? accessCookie.value : undefined;
const refreshValue = typeof refreshCookie?.value === 'string' ? refreshCookie.value : undefined;
const guestUser: PayloadInfo = {
username: "",