Skip to content

Commit

Permalink
handle no redirectTo set
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmacartney committed Aug 14, 2024
1 parent 25bdc9b commit 0a02c4c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions convex/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ export const { auth, signIn, signOut, store } = convexAuth({
providers: [GitHub, Resend],
callbacks: {
async redirect(params) {
console.log(params);
if (!params.redirectTo) {
if (!process.env.SITE_URL) {
throw new Error("SITE_URL is not set");
}
return process.env.SITE_URL;
}
const url = new URL(params.redirectTo);
if (
[
Expand Down

0 comments on commit 0a02c4c

Please sign in to comment.