Skip to content

Commit

Permalink
feat(@kampus/next-auth): add redirect callback for sign-in & sign-out (
Browse files Browse the repository at this point in the history
…#600)

# Description

The redirect problem solved in a hard-coded way. We need to find a way
to fetch the main url for production in the future.

Closes #516
  • Loading branch information
rasitds authored Aug 4, 2023
1 parent 5125163 commit d0de585
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/next-auth/.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Add envs to the app that is using the package
NODE_ENV="development"
AUTH_COOKIE_DOMAIN=''
GITHUB_ID=''
GITHUB_SECRET=''
Expand Down
3 changes: 3 additions & 0 deletions packages/next-auth/src/authOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,8 @@ export const authOptions: AuthOptions = {
},
};
},
redirect() {
return env.KAMPUS_ENV === "production" ? "https://dev.kamp.us" : "http://localhost:3000";
},
},
};

0 comments on commit d0de585

Please sign in to comment.