Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Fix domain API implementation

Steven Teyce4f94970ca9
diff --git a/components/app/modals/add-edit-domain-modal.tsx b/components/app/modals/add-edit-domain-modal.tsx
index df0ca5e250..a1c1eb222c 100644
--- a/components/app/modals/add-edit-domain-modal.tsx
+++ b/components/app/modals/add-edit-domain-modal.tsx
@@ -18,7 +18,6 @@ import useProject from "@/lib/swr/use-project";
import { AnimatePresence, motion } from "framer-motion";
import { SWIPE_REVEAL_ANIMATION_SETTINGS } from "@/lib/constants";
import Switch from "#/ui/switch";
-import useDomains from "@/lib/swr/use-domains";
import Button from "#/ui/button";
function AddEditDomainModal({
@@ -33,7 +32,6 @@ function AddEditDomainModal({
const router = useRouter();
const { slug } = router.query;
const { logo, plan } = useProject();
- const { domains } = useDomains();
const [data, setData] = useState<DomainProps>(
props || {
diff --git a/components/app/modals/add-project-modal.tsx b/components/app/modals/add-project-modal.tsx
index 35d79af6c3..7f85281bf0 100644
--- a/components/app/modals/add-project-modal.tsx
+++ b/components/app/modals/add-project-modal.tsx
@@ -60,14 +60,12 @@ function AddProjectModalHelper({
const [debouncedDomain] = useDebounce(domain, 500);
useEffect(() => {
if (debouncedDomain.length > 0) {
- fetch(`/api/projects/dub.sh/domains/${debouncedDomain}/exists`).then(
- async (res) => {
- if (res.status === 200) {
- const exists = await res.json();
- setDomainError(exists === 1 ? "Domain is already in use." : null);
- }
- },
- );
+ fetch(`/api/domains/${debouncedDomain}/exists`).then(async (res) => {
+ if (res.status === 200) {
+ const exists = await res.json();
+ setDomainError(exists === 1 ? "Domain is already in use." : null);
+ }
+ });
} else {
setDomainError(null);
}
diff --git a/lib/api/domains.ts b/lib/api/domains.ts
index ce97561710..982ec4fcd4 100644
--- a/lib/api/domains.ts
+++ b/lib/api/domains.ts
@@ -3,7 +3,10 @@ import { redis } from "@/lib/upstash";
import cloudinary from "cloudinary";
import { getApexDomain, validDomainRegex } from "@/lib/utils";
-export const validateDomain = async (domain: string) => {
+export const validateDomain = async (
+ domain: string,
+ projectId?: string | null,
+) => {
if (!domain || typeof domain !== "string") {
return "Missing domain";
}
@@ -13,14 +16,17 @@ export const validateDomain = async (domain: string) => {
if (!validDomain) {
return "Invalid domain";
}
- const exists = await domainExists(domain);
+ const exists = await domainExists(domain, projectId);
if (exists) {
return "Domain is already in use.";
}
return true;
};
-export const domainExists = async (domain: string) => {
+export const domainExists = async (
+ domain: string,
+ projectId?: string | null,
+) => {
const apexDomain = getApexDomain(`https://${domain}`);
const response = await prisma.domain.findFirst({
where: {
@@ -39,9 +45,16 @@ export const domainExists = async (domain: string) => {
},
select: {
slug: true,
+ ...(projectId && { projectId: true }),
},
});
- return response ? true : false;
+ if (response) {
+ if (projectId && response.projectId === projectId) {
+ return false;
+ }
+ return true;
+ }
+ return false;
};
interface CustomResponse extends Response {
@@ -49,7 +62,9 @@ interface CustomResponse extends Response {
error?: { code: string; projectId: string; message: string };
}
-export const addDomain = async (domain: string): Promise<CustomResponse> => {
+export const addDomainToVercel = async (
+ domain: string,
+): Promise<CustomResponse> => {
return await fetch(
`https://api.vercel.com/v9/projects/${process.env.PROJECT_ID_VERCEL}/domains?teamId=${process.env.TEAM_ID_VERCEL}`,
{
@@ -63,16 +78,47 @@ export const addDomain = async (domain: string): Promise<CustomResponse> => {
).then((res) => res.json());
};
-export const removeDomain = async (domain: string) => {
- return await fetch(
- `https://api.vercel.com/v6/domains/${domain}?teamId=${process.env.TEAM_ID_VERCEL}`,
- {
- headers: {
- Authorization: `Bearer ${process.env.AUTH_BEARER_TOKEN}`,
- },
- method: "DELETE",
+export const removeDomainFromVercel = async (domain: string) => {
+ const apexDomain = getApexDomain(`https://${domain}`);
+ const domainCount = await prisma.domain.count({
+ where: {
+ OR: [
+ {
+ slug: apexDomain,
+ },
+ {
+ slug: {
+ endsWith: `.${apexDomain}`,
+ },
+ },
+ ],
},
- ).then((res) => res.json());
+ });
+ if (domainCount > 1) {
+ // the apex domain is being used by other domains
+ // so we should only remove it from our Vercel project
+ return await fetch(
+ `https://api.vercel.com/v9/projects/${process.env.PROJECT_ID_VERCEL}/domains/${domain}?teamId=${process.env.TEAM_ID_VERCEL}`,
+ {
+ headers: {
+ Authorization: `Bearer ${process.env.AUTH_BEARER_TOKEN}`,
+ },
+ method: "DELETE",
+ },
+ ).then((res) => res.json());
+ } else {
+ // this is the only domain using this apex domain
+ // so we can remove it entirely from our Vercel team
+ return await fetch(
+ `https://api.vercel.com/v6/domains/${domain}?teamId=${process.env.TEAM_ID_VERCEL}`,
+ {
+ headers: {
+ Authorization: `Bearer ${process.env.AUTH_BEARER_TOKEN}`,
+ },
+ method: "DELETE",
+ },
+ ).then((res) => res.json());
+ }
};
export const getDomainResponse = async (domain: string) => {
diff --git a/lib/auth.ts b/lib/auth.ts
index 4e5a5b35f4..60ca683504 100644
--- a/lib/auth.ts
+++ b/lib/auth.ts
@@ -1,5 +1,5 @@
import { NextApiRequest, NextApiResponse } from "next";
-import { unstable_getServerSession } from "next-auth/next";
+import { getServerSession } from "next-auth/next";
import prisma from "@/lib/prisma";
import { PlanProps, ProjectProps, UserProps } from "@/lib/types";
import { authOptions } from "@/pages/api/auth/[...nextauth]";
@@ -12,13 +12,11 @@ export interface Session {
};
}
-export async function getServerSession(
- req: NextApiRequest,
- res: NextApiResponse,
-) {
+export async function getSession(req: NextApiRequest, res: NextApiResponse) {
// @ts-ignore
- return (await unstable_getServerSession(req, res, authOptions)) as Session;
+ return (await getServerSession(req, res, authOptions)) as Session;
}
+
interface WithProjectNextApiHandler {
(
req: NextApiRequest,
@@ -42,7 +40,7 @@ const withProjectAuth =
} = {},
) =>
async (req: NextApiRequest, res: NextApiResponse) => {
- const session = await getServerSession(req, res);
+ const session = await getSession(req, res);
if (!session?.user.id) return res.status(401).end("Unauthorized");
const { slug } = req.query;
@@ -140,7 +138,7 @@ const withUserAuth =
} = {},
) =>
async (req: NextApiRequest, res: NextApiResponse) => {
- const session = await getServerSession(req, res);
+ const session = await getSession(req, res);
if (!session?.user.id) return res.status(401).end("Unauthorized");
if (req.method === "GET") return handler(req, res, session);
diff --git a/lib/cron/domains.tsx b/lib/cron/domains.tsx
index 95391763c5..3d77bf46d7 100644
--- a/lib/cron/domains.tsx
+++ b/lib/cron/domains.tsx
@@ -2,7 +2,7 @@ import sendMail from "emails";
import InvalidDomain from "emails/InvalidDomain";
import DomainDeleted from "emails/DomainDeleted";
import { log } from "@/lib/utils";
-import { removeDomain } from "@/lib/api/domains";
+import { removeDomainFromVercel } from "@/lib/api/domains";
import prisma from "@/lib/prisma";
import { redis } from "../upstash";
@@ -78,7 +78,7 @@ export const handleDomainUpdates = async ({
// only delete if there are no links associated with the domain
if (linksCount === 0) {
return await Promise.all([
- removeDomain(domain), // remove domain from Vercel project
+ removeDomainFromVercel(domain), // remove domain from Vercel project
redis.del(`root:${domain}`), // there are no links anyway, so you can just delete the root domain from redis if exists
prisma.domain.delete({
where: {
diff --git a/package.json b/package.json
index 461ac3c112..8d9b02e823 100644
--- a/package.json
+++ b/package.json
@@ -41,7 +41,7 @@
"@visx/responsive": "^2.10.0",
"@visx/shape": "^2.12.2",
"@visx/tooltip": "^2.16.0",
- "cloudinary": "^1.32.0",
+ "cloudinary": "^1.36.4",
"clsx": "^1.2.1",
"cobe": "^0.6.2",
"contentlayer": "^0.3.2",
@@ -55,7 +55,7 @@
"mailing-core": "^0.9.1",
"ms": "^2.1.3",
"next": "^13.4.1",
- "next-auth": "^4.17.0",
+ "next-auth": "^4.22.1",
"next-contentlayer": "^0.3.2",
"node-html-parser": "^6.1.4",
"nodemailer": "^6.8.0",
diff --git a/pages/api/domains/[domain]/exists.ts b/pages/api/domains/[domain]/exists.ts
new file mode 100644
index 0000000000..03cf694b2f
--- /dev/null
+++ b/pages/api/domains/[domain]/exists.ts
@@ -0,0 +1,21 @@
+import { withUserAuth } from "@/lib/auth";
+import { domainExists } from "@/lib/api/domains";
+
+export default withUserAuth(async (req, res) => {
+ const { domain } = req.query as { domain: string };
+
+ // GET /api/domains/[domain]/exists – check if a domain exists
+ // This is used for project creation only, if you add a domain within an existing project,
+ // use the /api/projects/[slug]/domains/[domain]/exists endpoint instead
+ if (req.method === "GET") {
+ const exists = await domainExists(domain);
+ if (exists) {
+ return res.status(200).json(1);
+ } else {
+ return res.status(200).json(0);
+ }
+ } else {
+ res.setHeader("Allow", ["GET"]);
+ return res.status(405).json({ error: `Method ${req.method} Not Allowed` });
+ }
+});
diff --git a/pages/api/projects/[slug]/domains/[domain]/exists.ts b/pages/api/projects/[slug]/domains/[domain]/exists.ts
index fec9a6f60f..a3061997aa 100644
--- a/pages/api/projects/[slug]/domains/[domain]/exists.ts
+++ b/pages/api/projects/[slug]/domains/[domain]/exists.ts
@@ -1,24 +1,19 @@
-import { NextApiRequest, NextApiResponse } from "next";
-import { withUserAuth } from "@/lib/auth";
+import { withProjectAuth } from "@/lib/auth";
import { domainExists } from "@/lib/api/domains";
-export default withUserAuth(
- async (req: NextApiRequest, res: NextApiResponse) => {
- const { domain } = req.query as { domain: string };
+export default withProjectAuth(async (req, res, project) => {
+ const { domain } = req.query as { domain: string };
- // GET /api/projects/[slug]/domains/[domain]/exists – check if a domain exists
- if (req.method === "GET") {
- const exists = await domainExists(domain);
- if (exists) {
- return res.status(200).json(1);
- } else {
- return res.status(200).json(0);
- }
+ // GET /api/projects/[slug]/domains/[domain]/exists – check if a domain exists
+ if (req.method === "GET") {
+ const exists = await domainExists(domain, project.id);
+ if (exists) {
+ return res.status(200).json(1);
} else {
- res.setHeader("Allow", ["GET"]);
- return res
- .status(405)
- .json({ error: `Method ${req.method} Not Allowed` });
+ return res.status(200).json(0);
}
- },
-);
+ } else {
+ res.setHeader("Allow", ["GET"]);
+ return res.status(405).json({ error: `Method ${req.method} Not Allowed` });
+ }
+});
diff --git a/pages/api/projects/[slug]/domains/[domain]/index.ts b/pages/api/projects/[slug]/domains/[domain]/index.ts
index da696c6d86..4136ff09ae 100644
--- a/pages/api/projects/[slug]/domains/[domain]/index.ts
+++ b/pages/api/projects/[slug]/domains/[domain]/index.ts
@@ -1,5 +1,9 @@
import { withProjectAuth } from "@/lib/auth";
-import { addDomain, removeDomain, validateDomain } from "@/lib/api/domains";
+import {
+ addDomainToVercel,
+ removeDomainFromVercel,
+ validateDomain,
+} from "@/lib/api/domains";
import prisma from "@/lib/prisma";
import {
changeDomainForImages,
@@ -37,8 +41,8 @@ export default withProjectAuth(async (req, res, project) => {
if (req.method === "PUT") {
const { slug: newDomain, target, type, primary } = req.body;
- const validDomain = await validateDomain(newDomain);
- if (!validDomain) {
+ const validDomain = await validateDomain(newDomain, project.id);
+ if (validDomain !== true) {
return res.status(422).json({
domainError: validDomain,
});
@@ -52,8 +56,9 @@ export default withProjectAuth(async (req, res, project) => {
// 4. Update all images in the project to point to the new domain
...(newDomain !== domain
? [
- removeDomain(domain),
- addDomain(newDomain),
+ removeDomainFromVercel(domain).then(() =>
+ addDomainToVercel(newDomain),
+ ),
changeDomainForLinks(domain, newDomain),
changeDomainForImages(domain, newDomain),
]
@@ -104,7 +109,7 @@ export default withProjectAuth(async (req, res, project) => {
// DELETE /api/projects/[slug]/domains/[domain] delete a project's domain
} else if (req.method === "DELETE") {
const response = await Promise.allSettled([
- removeDomain(domain),
+ removeDomainFromVercel(domain),
deleteDomainLinks(domain),
prisma.domain.delete({
where: {
diff --git a/pages/api/projects/[slug]/domains/index.ts b/pages/api/projects/[slug]/domains/index.ts
index a08eca6df5..22f2a31988 100644
--- a/pages/api/projects/[slug]/domains/index.ts
+++ b/pages/api/projects/[slug]/domains/index.ts
@@ -1,6 +1,6 @@
import { withProjectAuth } from "@/lib/auth";
import prisma from "@/lib/prisma";
-import { addDomain, validateDomain } from "@/lib/api/domains";
+import { addDomainToVercel, validateDomain } from "@/lib/api/domains";
import { redis } from "@/lib/upstash";
export default withProjectAuth(async (req, res, project) => {
@@ -24,7 +24,7 @@ export default withProjectAuth(async (req, res, project) => {
} else if (req.method === "POST") {
const { slug: domain, primary, target, type } = req.body;
- const validDomain = await validateDomain(domain);
+ const validDomain = await validateDomain(domain, project.id);
if (validDomain !== true) {
return res.status(422).json({
domainError: validDomain,
@@ -38,7 +38,7 @@ export default withProjectAuth(async (req, res, project) => {
4. Add the domain to the database along with its primary status
*/
const response = await Promise.allSettled([
- addDomain(domain),
+ addDomainToVercel(domain),
target &&
redis.set(`root:${domain}`, {
target,
diff --git a/pages/api/projects/[slug]/index.ts b/pages/api/projects/[slug]/index.ts
index 2d28dd54cd..e6d8678821 100644
--- a/pages/api/projects/[slug]/index.ts
+++ b/pages/api/projects/[slug]/index.ts
@@ -1,5 +1,5 @@
import { withProjectAuth } from "@/lib/auth";
-import { removeDomain, deleteDomainLinks } from "@/lib/api/domains";
+import { removeDomainFromVercel, deleteDomainLinks } from "@/lib/api/domains";
import prisma from "@/lib/prisma";
export default withProjectAuth(async (req, res, project) => {
@@ -51,7 +51,7 @@ export default withProjectAuth(async (req, res, project) => {
slug,
},
}),
- ...domains.map((domain) => removeDomain(domain)),
+ ...domains.map((domain) => removeDomainFromVercel(domain)),
...domains.map((domain) => deleteDomainLinks(domain)),
]);
diff --git a/pages/api/projects/index.ts b/pages/api/projects/index.ts
index bc96dc23f7..76850bd91a 100644
--- a/pages/api/projects/index.ts
+++ b/pages/api/projects/index.ts
@@ -1,9 +1,13 @@
import { NextApiRequest, NextApiResponse } from "next";
import { Session, withUserAuth } from "@/lib/auth";
import { DEFAULT_REDIRECTS } from "@/lib/constants";
-import { addDomain, domainExists, validateDomain } from "@/lib/api/domains";
+import {
+ addDomainToVercel,
+ domainExists,
+ validateDomain,
+} from "@/lib/api/domains";
import prisma from "@/lib/prisma";
-import { getApexDomain, isReservedKey } from "@/lib/utils";
+import { isReservedKey } from "@/lib/utils";
export default withUserAuth(
async (req: NextApiRequest, res: NextApiResponse, session: Session) => {
@@ -38,7 +42,7 @@ export default withUserAuth(
slugError = "Cannot use reserved slugs";
}
const validDomain = await validateDomain(domain);
- if (slugError || !validDomain) {
+ if (slugError || validDomain !== true) {
return res.status(422).json({
slugError,
domainError: validDomain || "Invalid domain",
@@ -81,7 +85,7 @@ export default withUserAuth(
billingCycleStart: new Date().getDate(),
},
}),
- addDomain(domain),
+ addDomainToVercel(domain),
]);
return res.status(200).json(response);
diff --git a/yarn.lock b/yarn.lock
index 2d0191b9d5..f51919da84 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -181,6 +181,13 @@
dependencies:
regenerator-runtime "^0.13.10"
+"@babel/runtime@^7.20.13":
+ version "7.21.5"
+ resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.21.5.tgz#8492dddda9644ae3bda3b45eabe87382caee7200"
+ integrity sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q==
+ dependencies:
+ regenerator-runtime "^0.13.11"
+
"@babel/template@^7.16.7", "@babel/template@^7.18.10":
version "7.18.10"
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.18.10.tgz#6f9134835970d1dbf0835c0d100c9f38de0c5e71"
@@ -1147,10 +1154,10 @@
resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.5.0.tgz#cea9792bfcf556c87ded17c6ac729348697bb632"
integrity sha512-wlYG/U6ddW1ilXslnDLLQYJ8nd97W8JJTTfwkGhubx6dzW6SUkd+N4/MzTjjyZlrHQunxHtkHFvVpUKiROvFDw==
-"@panva/hkdf@^1.0.1":
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/@panva/hkdf/-/hkdf-1.0.2.tgz#bab0f09d09de9fd83628220d496627681bc440d6"
- integrity sha512-MSAs9t3Go7GUkMhpKC44T58DJ5KGk2vBo+h1cqQeqlMfdGkxaVB78ZWpv9gYi/g2fa4sopag9gJsNvS8XGgWJA==
+"@panva/hkdf@^1.0.2":
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/@panva/hkdf/-/hkdf-1.1.1.tgz#ab9cd8755d1976e72fc77a00f7655a64efe6cd5d"
+ integrity sha512-dhPeilub1NuIG0X5Kvhh9lH4iW3ZsHlnzwgwbOlgwQ2wG1IqFzsgHqmKPk3WzsdWAeaxKJxgM0+W433RmN45GA==
"@peculiar/asn1-schema@^2.1.6", "@peculiar/asn1-schema@^2.3.0":
version "2.3.3"
@@ -3134,20 +3141,20 @@ clone@^1.0.2:
resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e"
integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==
-cloudinary-core@^2.10.2:
version "2.13.0"
resolved "https://registry.yarnpkg.com/cloudinary-core/-/cloudinary-core-2.13.0.tgz#b59f90871b6c708c3d0735b9be47ac08181c57fb"
integrity sha512-Nt0Q5I2FtenmJghtC4YZ3MZZbGg1wLm84SsxcuVwZ83OyJqG9CNIGp86CiI6iDv3QobaqBUpOT7vg+HqY5HxEA==
-cloudinary@^1.32.0:
- version "1.32.0"
- resolved "https://registry.yarnpkg.com/cloudinary/-/cloudinary-1.32.0.tgz#13e16f8238aa8d49b61db16450590c802a79e21c"
- integrity sha512-hbc5/ilOkwD49+Lucqze3z+2Tejc3YdH4tkI+y1Ciabi9Qh9MYcy4M3rYeDAYiMS/jIz5FfHOzx+JjVnPJxNAQ==
+cloudinary@^1.36.4:
+ version "1.36.4"
+ resolved "https://registry.yarnpkg.com/cloudinary/-/cloudinary-1.36.4.tgz#007ee710a63ca6887f18b20505f03f1780eab298"
+ integrity sha512-F/90SVQdUbbEipCS4jTRvUt1lzJ7tcbu7n5zPTtXq83Qj7y9AazLZmU5BdWTQLjPJ82Cq/nr67GCnWDxWATWxg==
dependencies:
- cloudinary-core "^2.10.2"
- core-js "^3.6.5"
- lodash "^4.17.21"
- q "^1.5.1"
+ cloudinary-core "2.13.0"
+ core-js "3.30.1"
+ lodash "4.17.21"
+ q "1.5.1"
optionalDependencies:
proxy-agent "^5.0.0"
@@ -3314,16 +3321,16 @@ cookie@~0.4.1:
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432"
integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==
+ version "3.30.1"
+ resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.30.1.tgz#fc9c5adcc541d8e9fa3e381179433cbf795628ba"
+ integrity sha512-ZNS5nbiSwDTq4hFosEDqm65izl2CWmLz0hARJMyNQBgkUZMIF51cQiMvIQKA6hvuaeWxQDP3hEedM1JZIgTldQ==
+
core-js@^2.4.0:
version "2.6.12"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec"
integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==
-core-js@^3.6.5:
- version "3.26.1"
- resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.26.1.tgz#7a9816dabd9ee846c1c0fe0e8fcad68f3709134e"
- integrity sha512-21491RRQVzUn0GGM9Z1Jrpr6PNPxPi+Za8OM9q4tksTSnlbXXGKK1nXNg/QvwFYettXvSX6zWKCtHHfjN4puyA==
-
core-util-is@^1.0.3, core-util-is@~1.0.0:
version "1.0.3"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85"
@@ -5047,10 +5054,10 @@ jiti@^1.18.2:
resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.18.2.tgz#80c3ef3d486ebf2450d9335122b32d121f2a83cd"
integrity sha512-QAdOptna2NYiSSpv0O/BwoHBSmz4YhpzJHyi+fnMRTXFjp7B8i/YG5Z8IfusxB1ufjcD2Sre1F3R+nX3fvy7gg==
-jose@^4.10.0, jose@^4.9.3:
- version "4.11.1"
- resolved "https://registry.yarnpkg.com/jose/-/jose-4.11.1.tgz#8f7443549befe5bddcf4bae664a9cbc1a62da4fa"
- integrity sha512-YRv4Tk/Wlug8qicwqFNFVEZSdbROCHRAC6qu/i0dyNKr5JQdoa2pIGoS04lLO/jXQX7Z9omoNewYIVIxqZBd9Q==
+jose@^4.11.4, jose@^4.14.1:
+ version "4.14.4"
+ resolved "https://registry.yarnpkg.com/jose/-/jose-4.14.4.tgz#59e09204e2670c3164ee24cbfe7115c6f8bff9ca"
+ integrity sha512-j8GhLiKmUAh+dsFXlX1aJCbt5KMibuKb+d7j1JaOJG6s2UjX1PQlW+OKB/sD4a/5ZYF4RcmYmLSndOoU3Lt/3g==
js-beautify@^1.6.14:
version "1.14.7"
@@ -6669,17 +6676,17 @@ netmask@^2.0.2:
resolved "https://registry.yarnpkg.com/netmask/-/netmask-2.0.2.tgz#8b01a07644065d536383835823bc52004ebac5e7"
integrity sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==
-next-auth@^4.17.0:
- version "4.17.0"
- resolved "https://registry.yarnpkg.com/next-auth/-/next-auth-4.17.0.tgz#776d2a0999d4e2eb56968cad282c1ecd37516a2c"
- integrity sha512-aN2tdnjS0MDeUpB2tBDOaWnegkgeMWrsccujbXRGMJ607b+EwRcy63MFGSr0OAboDJEe0902piXQkt94GqF8Qw==
+next-auth@^4.22.1:
+ version "4.22.1"
+ resolved "https://registry.yarnpkg.com/next-auth/-/next-auth-4.22.1.tgz#1ea5084e38867966dc6492a71c6729c8f5cfa96b"
+ integrity sha512-NTR3f6W7/AWXKw8GSsgSyQcDW6jkslZLH8AiZa5PQ09w1kR8uHtR9rez/E9gAq/o17+p0JYHE8QjF3RoniiObA==
dependencies:
- "@babel/runtime" "^7.16.3"
- "@panva/hkdf" "^1.0.1"
+ "@babel/runtime" "^7.20.13"
+ "@panva/hkdf" "^1.0.2"
cookie "^0.5.0"
- jose "^4.9.3"
+ jose "^4.11.4"
oauth "^0.9.15"
- openid-client "^5.1.0"
+ openid-client "^5.4.0"
preact "^10.6.3"
preact-render-to-string "^5.1.19"
uuid "^8.3.2"
@@ -7056,7 +7063,7 @@ object-assign@^4, object-assign@^4.0.1, object-assign@^4.1.1:
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==
-object-hash@^2.0.1:
+object-hash@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-2.2.0.tgz#5ad518581eefc443bd763472b8ff2e9c2c0d54a5"
integrity sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw==
@@ -7071,10 +7078,10 @@ object-inspect@^1.9.0:
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea"
integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==
-oidc-token-hash@^5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/oidc-token-hash/-/oidc-token-hash-5.0.1.tgz#ae6beec3ec20f0fd885e5400d175191d6e2f10c6"
- integrity sha512-EvoOtz6FIEBzE+9q253HsLCVRiK/0doEJ2HCvvqMQb3dHZrP3WlJKYtJ55CRTw4jmYomzH4wkPuCj/I3ZvpKxQ==
+oidc-token-hash@^5.0.3:
+ version "5.0.3"
+ resolved "https://registry.yarnpkg.com/oidc-token-hash/-/oidc-token-hash-5.0.3.tgz#9a229f0a1ce9d4fc89bcaee5478c97a889e7b7b6"
+ integrity sha512-IF4PcGgzAr6XXSff26Sk/+P4KZFJVuHAJZj3wgO3vX2bMdNVp/QXTP3P7CEm9V1IdG8lDLY3HhiqpsE/nOwpPw==
on-change@^4.0.0:
version "4.0.2"
@@ -7102,15 +7109,15 @@ open@^8.4.0:
is-docker "^2.1.1"
is-wsl "^2.2.0"
-openid-client@^5.1.0:
- version "5.3.0"
- resolved "https://registry.yarnpkg.com/openid-client/-/openid-client-5.3.0.tgz#e0fa433bb7a156b09d8cbb100abe95b322aa42be"
- integrity sha512-SykPCeZBZ/SxiBH5AWynvFUIDX3//2pgwc/3265alUmGHeCN03+X8uP+pHOVnCXCKfX/XOhO90qttAQ76XcGxA==
+openid-client@^5.4.0:
+ version "5.4.2"
+ resolved "https://registry.yarnpkg.com/openid-client/-/openid-client-5.4.2.tgz#8692bcc2a40ef3426c5ba5c11f7493599e93ccc7"
+ integrity sha512-lIhsdPvJ2RneBm3nGBBhQchpe3Uka//xf7WPHTIglery8gnckvW7Bd9IaQzekzXJvWthCMyi/xVEyGW0RFPytw==
dependencies:
- jose "^4.10.0"
+ jose "^4.14.1"
lru-cache "^6.0.0"
- object-hash "^2.0.1"
- oidc-token-hash "^5.0.1"
+ object-hash "^2.2.0"
+ oidc-token-hash "^5.0.3"
optionator@^0.8.1:
version "0.8.3"
@@ -7631,7 +7638,7 @@ pvutils@^1.1.3:
resolved "https://registry.yarnpkg.com/pvutils/-/pvutils-1.1.3.tgz#f35fc1d27e7cd3dfbd39c0826d173e806a03f5a3"
integrity sha512-pMpnA0qRdFp32b1sJl1wOJNxZLQ2cbQx+k6tjNtZ8CpvVhNqEPRgivZ2WOUev2YMajecdH7ctUPDvEe87nariQ==
-q@^1.5.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7"
integrity sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==
@@ -7907,7 +7914,7 @@ regenerator-runtime@^0.10.0:
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658"
integrity sha512-02YopEIhAgiBHWeoTiA8aitHDt8z6w+rQqNuIftlM+ZtvSl/brTouaU7DW6GO/cHtvxJvS4Hwv2ibKdxIRi24w==
-regenerator-runtime@^0.13.10:
+regenerator-runtime@^0.13.10, regenerator-runtime@^0.13.11:
version "0.13.11"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9"
integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==