naystack - v1.5.10
    Preparing search index...

    Function getTokenizedResponse

    • Builds a NextResponse with access/refresh tokens in the JSON body and sets the refresh cookie.

      • If accessToken is omitted, the refresh cookie is cleared (logout).
      • If refreshToken is empty string, the cookie expires immediately (logout).
      • If refreshToken is a valid string, the cookie is set for 1 year.

      Parameters

      • OptionalaccessToken: string

        Optional access JWT to include in response body.

      • OptionalrefreshToken: string

        Optional refresh JWT to set as httpOnly cookie. Empty string clears the cookie.

      Returns NextResponse<
          { accessToken: string
          | undefined; refreshToken: string | undefined },
      >

      NextResponse with JSON body and Set-Cookie headers.