UNPKG

@lucia-auth/nextjs

Version:
16 lines (15 loc) 509 B
export const convertNextRequestToStandardRequest = (req) => { const url = `${process.env.NODE_ENV === "production" ? "https" : "http"}://${req.headers.host}${req.url}`; return { headers: { get: (name) => { const value = req.headers[name.toLocaleLowerCase()] || null; if (Array.isArray(value)) return value.toString(); return value; } }, url, method: req.method || "" }; };