From 608f9a590e4dd764c800ab5533b2edbabd5e62a9 Mon Sep 17 00:00:00 2001 From: Stefanos Anagnostou Date: Tue, 5 Dec 2023 16:35:09 +0200 Subject: [PATCH] fix(*): Fix retheme deployment preview template (#2263) --- playground/nextjs/pages/_app.tsx | 5 ++++- playground/nextjs/pages/api/sendEmail.ts | 4 ++-- playground/nextjs/pages/session-examples/index.tsx | 4 ++-- playground/nextjs/pages/user-examples/index.tsx | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/playground/nextjs/pages/_app.tsx b/playground/nextjs/pages/_app.tsx index 0b3a9a27d5..b63cb24b60 100644 --- a/playground/nextjs/pages/_app.tsx +++ b/playground/nextjs/pages/_app.tsx @@ -73,7 +73,10 @@ const AppBar = (props: AppBarProps) => { hidePersonal afterLeaveOrganizationUrl={'https://www.google.com'} /> - +

Nextjs Playground

diff --git a/playground/nextjs/pages/api/sendEmail.ts b/playground/nextjs/pages/api/sendEmail.ts index 4c665a68f6..4db7885a28 100644 --- a/playground/nextjs/pages/api/sendEmail.ts +++ b/playground/nextjs/pages/api/sendEmail.ts @@ -1,12 +1,12 @@ import type { NextApiRequest, NextApiResponse } from 'next'; -import { getAuth, clerkClient } from '@clerk/nextjs/server'; +import { clerkClient, getAuth } from '@clerk/nextjs/server'; export default async function handler(req: NextApiRequest, res: NextApiResponse) { const { userId } = await getAuth(req); if (!userId) return res.status(401); const user = await clerkClient.users.getUser(userId); - const email = user.primaryEmailAddressId; + const email = user.data?.primaryEmailAddressId; if (!email) return res.status(422).json({ error: 'primaryEmailAddress is required!' }); diff --git a/playground/nextjs/pages/session-examples/index.tsx b/playground/nextjs/pages/session-examples/index.tsx index 752070f11e..ca392b7c9a 100644 --- a/playground/nextjs/pages/session-examples/index.tsx +++ b/playground/nextjs/pages/session-examples/index.tsx @@ -1,4 +1,4 @@ -import { WithSession, withSession, WithSessionProp, useSession } from '@clerk/nextjs'; +import { useSession, withSession, WithSession, WithSessionProp } from '@clerk/nextjs'; import { PublicUserData } from '@clerk/types'; import type { NextPage } from 'next'; import React from 'react'; @@ -49,7 +49,7 @@ const SessionExamplesPage: NextPage = () => { - + {/**/} ); }; diff --git a/playground/nextjs/pages/user-examples/index.tsx b/playground/nextjs/pages/user-examples/index.tsx index e0a349a652..3b543b83e5 100644 --- a/playground/nextjs/pages/user-examples/index.tsx +++ b/playground/nextjs/pages/user-examples/index.tsx @@ -53,7 +53,7 @@ const UserExamplesPage: NextPage = () => { - + {/**/} ); };