Skip to content

Commit

Permalink
chore: callback error
Browse files Browse the repository at this point in the history
  • Loading branch information
peterphanouvong committed Jul 29, 2024
1 parent 3b506f1 commit 3ab16c8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/handlers/callback.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ export const callback = async (routerClient) => {
routerClient.getUrl()
);
} catch (error) {
if (config.isDebugMode) {
console.error('callback', error);
}
return routerClient.json({error: error.message}, {status: 500});
}
if (postLoginRedirectURL) {
if (postLoginRedirectURL.startsWith('http')) {
return routerClient.redirect(postLoginRedirectURL);
return routerClient.redirect(postLoginRedirectURL);
}
return routerClient.redirect(
`${routerClient.clientConfig.siteUrl}${postLoginRedirectURL}`
Expand Down

0 comments on commit 3ab16c8

Please sign in to comment.