export const authorize = basicRealm => { return async (c, next) => { if (c.get('isAuthenticated')) { return next(); } const headers = { 'WWW-Authenticate': `Basic realm="${basicRealm}"`, }; if (c.req.method === 'GET') { return c.text('', 401, headers); } return c.json({ error: 'Authentication required' }, 401, headers); }; }; //# sourceMappingURL=authorize.js.map