From a969e0a8e9978764c08803dfa94ea9fb98c5ea64 Mon Sep 17 00:00:00 2001 From: Robin Date: Thu, 2 Feb 2023 11:35:29 +0530 Subject: [PATCH 1/3] Update examples to TS --- docs/docs/configuration/pages.md | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/docs/docs/configuration/pages.md b/docs/docs/configuration/pages.md index 8ba1949029..afe98783b1 100644 --- a/docs/docs/configuration/pages.md +++ b/docs/docs/configuration/pages.md @@ -77,13 +77,14 @@ In addition, you can define a `theme.brandColor` to define a custom accent color In order to get the available authentication providers and the URLs to use for them, you can make a request to the API endpoint `/api/auth/providers`: -```jsx title="pages/auth/signin.js" +```tsx title="pages/auth/signin.ts" +import type { GetServerSidePropsContext, InferGetServerSidePropsType } from "next"; import { getProviders, signIn } from "next-auth/react" -export default function SignIn({ providers }) { +export default function SignIn({ providers }: InferGetServerSidePropsType) { return ( <> - {Object.values(providers).map((provider) => ( + {providers && Object.values(providers).map((provider) => (