@@ -17,7 +17,7 @@ import { GithubConnectionConfig } from "@sourcebot/schemas/v3/github.type";
1717import { GitlabConnectionConfig } from "@sourcebot/schemas/v3/gitlab.type" ;
1818import { getPlan , hasEntitlement } from "@sourcebot/shared" ;
1919import { StatusCodes } from "http-status-codes" ;
20- import { cookies , headers } from "next/headers" ;
20+ import { cookies } from "next/headers" ;
2121import { createTransport } from "nodemailer" ;
2222import { Octokit } from "octokit" ;
2323import { auth } from "./auth" ;
@@ -891,7 +891,6 @@ export const createInvites = async (emails: string[], domain: string): Promise<{
891891
892892 // Send invites to recipients
893893 if ( env . SMTP_CONNECTION_URL && env . EMAIL_FROM_ADDRESS ) {
894- const origin = ( await headers ( ) ) . get ( 'origin' ) ! ;
895894 await Promise . all ( emails . map ( async ( email ) => {
896895 const invite = await prisma . invite . findUnique ( {
897896 where : {
@@ -914,7 +913,7 @@ export const createInvites = async (emails: string[], domain: string): Promise<{
914913 email,
915914 } ,
916915 } ) ;
917- const inviteLink = `${ origin } /redeem?invite_id=${ invite . id } ` ;
916+ const inviteLink = `${ env . AUTH_URL } /redeem?invite_id=${ invite . id } ` ;
918917 const transport = createTransport ( env . SMTP_CONNECTION_URL ) ;
919918 const html = await render ( InviteUserEmail ( {
920919 host : {
@@ -1583,10 +1582,8 @@ export const approveAccountRequest = async (requestId: string, domain: string) =
15831582
15841583 // Send approval email to the user
15851584 if ( env . SMTP_CONNECTION_URL && env . EMAIL_FROM_ADDRESS ) {
1586- const origin = ( await headers ( ) ) . get ( 'origin' ) ! ;
1587-
15881585 const html = await render ( JoinRequestApprovedEmail ( {
1589- baseUrl : origin ,
1586+ baseUrl : env . AUTH_URL ,
15901587 user : {
15911588 name : request . requestedBy . name ?? undefined ,
15921589 email : request . requestedBy . email ! ,
0 commit comments