1export async function handler(req) {2> reading three call sites3- await rateLimit(req, { max: 100 });4+ await rateLimit(req, { max: 100, burst: 20 });5 if (!data.name) throw new Error();6 return schema.parse(data);7}89> migrating auth from sessions to JWT10- const session = await getSession(req);11+ const token = extractBearer(req);12+ if (!token) return unauthorized(req);13 const user = await verify(token);14 return withRetry(handler)(user);15}
1export async function handler(req) {2> reading three call sites3- await rateLimit(req, { max: 100 });4+ await rateLimit(req, { max: 100, burst: 20 });5 if (!data.name) throw new Error();6 return schema.parse(data);7}89> migrating auth from sessions to JWT10- const session = await getSession(req);11+ const token = extractBearer(req);12+ if (!token) return unauthorized(req);13 const user = await verify(token);14 return withRetry(handler)(user);15}