Skip to content

Commit f546a4a

Browse files
committed
Display error if no [...nextauth].js found
fixes nextauthjs#647
1 parent e6995d2 commit f546a4a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/server/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ export default async (req, res, userSuppliedOptions) => {
3232
// safe to return and that no more data will be sent.
3333
const done = resolve
3434

35+
if (!req.query.nextauth) {
36+
res
37+
.status(500)
38+
.end(
39+
'Error: Cannot find [...nextauth].js in pages/api/auth. Make sure the filename is written correctly.'
40+
)
41+
return done()
42+
}
43+
3544
const { url, query, body } = req
3645
const {
3746
nextauth,

0 commit comments

Comments
 (0)