Skip to content

Commit 26be1d4

Browse files
committed
able to log in again
the `signIn` function from "next-auth/react" uses `fetcher` and returns a 404 error response. throwing that error causes an `OAUTH_CALLBACK_HANDLER_ERROR`, which prevents users from signing in. `signIn` doesn't pass a url to `fetcher`. the check below ensures that other errors still get thrown - ref: #321
1 parent eb6224f commit 26be1d4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

utils/api/base.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ export const fetcher = (url, token) => {
1111
.then(res => res.data)
1212
.catch(error => {
1313
Sentry.captureException(error)
14-
throw error
14+
// the `signIn` function from "next-auth/react" uses `fetcher` and returns a 404 error response. throwing that error causes an
15+
// `OAUTH_CALLBACK_HANDLER_ERROR`, which prevents users from signing in. `signIn` doesn't pass a url to `fetcher`. the check below
16+
// ensures that other errors still get thrown
17+
if (error.config.url !== null) throw error
1518
})
1619
}
1720

0 commit comments

Comments
 (0)