Skip to content

Commit 2c1650b

Browse files
authored
Merge pull request #388 from scientist-softserv/321-restore-login
321-restore-login
2 parents eb6224f + 26be1d4 commit 2c1650b

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)