File size: 403 Bytes
eeb9404
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import { NextRequest, NextResponse } from 'next/server';
import { CODEX_COOKIE_NAME } from '../cookie';

/**
 * Returns whether the HttpOnly refresh token cookie exists.
 * Used by the client for mount-time reconciliation.
 */
export async function GET(request: NextRequest) {
  const hasRefreshToken = !!request.cookies.get(CODEX_COOKIE_NAME)?.value;
  return NextResponse.json({ hasRefreshToken });
}