diff --git a/lib/emails/invitation.ts b/lib/emails/invitation.ts index bd4ed79d..2ee584b4 100644 --- a/lib/emails/invitation.ts +++ b/lib/emails/invitation.ts @@ -51,13 +51,13 @@ const html = (invitation: any) => `
- Join team + Join team
diff --git a/next.config.js b/next.config.js index e8b36e89..b0ef7d5c 100644 --- a/next.config.js +++ b/next.config.js @@ -1,6 +1,11 @@ const withTM = require('next-transpile-modules')(['react-timezone-select']); +// TODO: Revisit this later with getStaticProps in App +if (process.env.NEXTAUTH_URL) { + process.env.BASE_URL = process.env.NEXTAUTH_URL.replace('/api/auth', ''); +} + if ( ! process.env.EMAIL_FROM ) { console.warn('\x1b[33mwarn', '\x1b[0m', 'EMAIL_FROM environment variable is not set, this may indicate mailing is currently disabled. Please refer to the .env.example file.'); } diff --git a/pages/api/teams.ts b/pages/api/teams.ts index 33d1038d..1ab69adb 100644 --- a/pages/api/teams.ts +++ b/pages/api/teams.ts @@ -30,7 +30,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) } }); - return res.status(201).setHeader('Location', 'https://calendso.alexvanandel.com/api/teams/1').send(null); + return res.status(201).setHeader('Location', process.env.BASE_URL + '/api/teams/1').send(null); } res.status(404).send(null);