Builds a NextResponse with access/refresh tokens in the JSON body and sets the refresh cookie.
accessToken
refreshToken
Optional
Optional access JWT to include in response body.
Optional refresh JWT to set as httpOnly cookie. Empty string clears the cookie.
NextResponse with JSON body and Set-Cookie headers.
Builds a NextResponse with access/refresh tokens in the JSON body and sets the refresh cookie.
accessTokenis omitted, the refresh cookie is cleared (logout).refreshTokenis empty string, the cookie expires immediately (logout).refreshTokenis a valid string, the cookie is set for 1 year.