Skip to content

Commit 3cb75e3

Browse files
committed
capture options requests
1 parent dda65c1 commit 3cb75e3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/middlewares/base-handler.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ export function createBaseHandler() {
5858

5959
// Add session to request
6060
baseHandler.use(async (req, res, next) => {
61+
if (req.method === 'OPTIONS') {
62+
res.status(200).end()
63+
return
64+
}
65+
6166
/** Handle authorization using either Bearer token auth or
6267
* using the next-auth session
6368
*/

0 commit comments

Comments
 (0)