Releases
Minor Changes
-
3b10b13: feat: add blitz auth support for the Web
Request
API standardUsage using the new
withBlitzAuth
adapter in the App Router:import {withBlitzAuth} from "app/blitz-server" export const {POST} = withBlitzAuth({ POST: async (_request, _params, ctx) => { const session = ctx.session await session.$revoke() return new Response( JSON.stringify({ userId: session.userId, }), {status: 200}, ) }, })
feat: New Blitz RPC handler meant to with the next.js app router
route.ts
filesUsage using the new
rpcAppHandler
function// app/api/rpc/[[...blitz]]/route.ts import {rpcAppHandler} from "@blitzjs/rpc" import {withBlitzAuth} from "app/blitz-server" // Usage with blitz auth export const {GET, POST, HEAD} = withBlitzAuth(rpcAppHandler()) // Standalone usage export const {GET, POST, HEAD} = rpcAppHandler()
chore: Update the app directory starter
Patch Changes
- d53da39: Improved parsing of default export names to handle higher-order components (HOCs) in the
parseDefaultExportName
function.