MCPcopy Create free account
hub / github.com/vercel/examples / handler

Function handler

edge-middleware/basic-auth-password/pages/api/auth.ts:3–7  ·  view source on GitHub ↗
(_: NextApiRequest, res: NextApiResponse)

Source from the content-addressed store, hash-verified

1import type { NextApiRequest, NextApiResponse } from 'next'
2
3export default function handler(_: NextApiRequest, res: NextApiResponse) {
4 res.setHeader('WWW-authenticate', 'Basic realm="Secure Area"')
5 res.statusCode = 401
6 res.end(`Auth Required.`)
7}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected