mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-24 16:11:53 -05:00
docs(hono): clarify CORS middleware must be registered before routes (#3707)
- Add complete example showing app.on() and serve() after CORS setup - Include important note explaining CORS must come before route registration - Ensures consistency with middleware section and prevents user confusion - Critical for proper cross-origin request handling in authentication endpoints
This commit is contained in:
@@ -48,8 +48,14 @@ app.use(
|
||||
}),
|
||||
);
|
||||
|
||||
app.on(["POST", "GET"], "/api/auth/*", (c) => {
|
||||
return auth.handler(c.req.raw);
|
||||
});
|
||||
|
||||
serve(app);
|
||||
```
|
||||
|
||||
> **Important:** CORS middleware must be registered before your routes. This ensures that cross-origin requests are properly handled before they reach your authentication endpoints.
|
||||
|
||||
### Middleware
|
||||
|
||||
|
||||
Reference in New Issue
Block a user