Skip to content

Commit

Permalink
basePath for SessionProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
agnlez committed Jan 30, 2025
1 parent d79e80c commit 4e46ed8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion client/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ const MyApp: React.FC<AppProps> = ({ Component, pageProps }: AppProps) => {
return (
<QueryClientProvider client={queryClient}>
<Hydrate state={pageProps.dehydratedState}>
<SessionProvider session={pageProps.session}>
<SessionProvider
session={pageProps.session}
basePath={`${process.env.NEXT_PUBLIC_BASE_PATH}/api/auth`}
>
{/* @ts-ignore: https://github.com/artsy/fresnel/issues/281 */}
<MediaContextProvider>
<PlausibleProvider domain={process.env.NEXT_PUBLIC_PLAUSIBLE_DOMAIN}>
Expand Down
3 changes: 2 additions & 1 deletion client/src/pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export const authOptions: NextAuthOptions = {
* By default Next-Auth provides /api/auth/signin
*/
pages: {
signIn: '/auth/signin',
signIn: `${process.env.NEXT_PUBLIC_BASE_PATH}/auth/signin`,
signOut: `${process.env.NEXT_PUBLIC_BASE_PATH}`,
},

session: {
Expand Down

0 comments on commit 4e46ed8

Please sign in to comment.