fix: use next-runtime-env for baseUrl
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { TRPCError } from "@trpc/server";
|
import { TRPCError } from "@trpc/server";
|
||||||
|
import { env } from "next-runtime-env";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import * as inviteLinkRepo from "@kan/db/repository/inviteLink.repo";
|
import * as inviteLinkRepo from "@kan/db/repository/inviteLink.repo";
|
||||||
@@ -307,7 +308,7 @@ export const memberRouter = createTRPCRouter({
|
|||||||
return {
|
return {
|
||||||
id: activeInviteLink.id,
|
id: activeInviteLink.id,
|
||||||
inviteCode: activeInviteLink.code,
|
inviteCode: activeInviteLink.code,
|
||||||
inviteLink: `${process.env.NEXT_PUBLIC_BASE_URL}/invite/${activeInviteLink.code}`,
|
inviteLink: `${env("NEXT_PUBLIC_BASE_URL")}/invite/${activeInviteLink.code}`,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
expiresAt: activeInviteLink.expiresAt ?? undefined,
|
expiresAt: activeInviteLink.expiresAt ?? undefined,
|
||||||
};
|
};
|
||||||
@@ -415,7 +416,7 @@ export const memberRouter = createTRPCRouter({
|
|||||||
return {
|
return {
|
||||||
publicId: inviteLink.publicId,
|
publicId: inviteLink.publicId,
|
||||||
inviteCode: inviteLink.code,
|
inviteCode: inviteLink.code,
|
||||||
inviteLink: `${process.env.NEXT_PUBLIC_BASE_URL}/invite/${inviteLink.code}`,
|
inviteLink: `${env("NEXT_PUBLIC_BASE_URL")}/invite/${inviteLink.code}`,
|
||||||
expiresAt: inviteLink.expiresAt,
|
expiresAt: inviteLink.expiresAt,
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { SignJWT } from "jose";
|
import { SignJWT } from "jose";
|
||||||
|
import { env } from "next-runtime-env";
|
||||||
|
|
||||||
const encoder = new TextEncoder();
|
const encoder = new TextEncoder();
|
||||||
|
|
||||||
@@ -14,7 +15,7 @@ const encoder = new TextEncoder();
|
|||||||
export async function createEmailUnsubscribeLink(
|
export async function createEmailUnsubscribeLink(
|
||||||
userId: string,
|
userId: string,
|
||||||
): Promise<string | null> {
|
): Promise<string | null> {
|
||||||
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL;
|
const baseUrl = env("NEXT_PUBLIC_BASE_URL");
|
||||||
const secret = process.env.EMAIL_UNSUBSCRIBE_SECRET;
|
const secret = process.env.EMAIL_UNSUBSCRIBE_SECRET;
|
||||||
|
|
||||||
if (!baseUrl || !secret) {
|
if (!baseUrl || !secret) {
|
||||||
|
|||||||
Reference in New Issue
Block a user