© 2026 Hedgehog Software, LLC
HttpApiError.Unauthorized
WWW-Authenticate
export class Authorization extends HttpApiMiddleware.Tag<Authorization>()( "Authorization", { failure: Schema.Union(HttpApiError.Unauthorized, HttpApiError.InternalServerError), provides: CurrentUser, security: { basic: HttpApiSecurity.basic, }, }, ) {} export const AuthorizationLive = Layer.effect( Authorization, Effect.gen(function* () { const auth = yield* AuthService; return { basic: ({ username, password }) => Effect.catchTags( auth.basic(username, password), { UnauthorizedError: () => Effect.fail(new HttpApiError.Unauthorized()), // <-- How do I add headers to this? SqlError: () => Effect.fail(new HttpApiError.InternalServerError()), }, ), } }), );