-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
I tried to use auth0-hono in a honox project deployed on Cloudflare Pages, following the official documentation, but it did not work as expected.
After investigating, I found the following points are required for it to work properly, but they are not clearly documented:
Key points
- Environment variables must be accessed via
c.env, notprocess.env, when running on Cloudflare Pages. - The
authmiddleware needs to be added to_middleware.ts, notserver.ts.
Example
// _middleware.ts
export const myAuth = (c: Context<OIDCEnv>, next: Next) => {
const a = auth({
domain: c.env.AUTH0_DOMAIN || '',
// etc.
});
return a(c, next);
};
export default createRoute(myAuth);It would be helpful if the documentation mentioned these requirements explicitly, especially for users deploying honox on Cloudflare Pages.
Metadata
Metadata
Assignees
Labels
No labels