From 6b83ed7d773ec3ede5d51ec1512057b2f7083d06 Mon Sep 17 00:00:00 2001 From: Alex FusionAuth Date: Sat, 16 Sep 2023 16:17:18 -0400 Subject: [PATCH] fix login link --- complete-application/src/app/page.tsx | 5 ++--- .../src/components/LoginButton.tsx | 1 - .../src/components/LoginLink.tsx | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 complete-application/src/components/LoginLink.tsx diff --git a/complete-application/src/app/page.tsx b/complete-application/src/app/page.tsx index f172173..247ca63 100644 --- a/complete-application/src/app/page.tsx +++ b/complete-application/src/app/page.tsx @@ -2,7 +2,7 @@ import { getServerSession } from 'next-auth'; import Image from 'next/image'; import { redirect } from 'next/navigation'; import { authOptions } from './api/auth/[...nextauth]/route'; -import LoginButton from '../components/LoginButton'; +import LoginLink from '../components/LoginLink'; export default async function Home() { const session = await getServerSession(authOptions); @@ -17,8 +17,7 @@ export default async function Home() {

Welcome to Changebank

-

To get started

- +
diff --git a/complete-application/src/components/LoginButton.tsx b/complete-application/src/components/LoginButton.tsx index 9415ae9..93aa4e2 100644 --- a/complete-application/src/components/LoginButton.tsx +++ b/complete-application/src/components/LoginButton.tsx @@ -15,7 +15,6 @@ export default function LoginButton({ session }: { session: any }) { } return ( <> - Status: Not logged in
diff --git a/complete-application/src/components/LoginLink.tsx b/complete-application/src/components/LoginLink.tsx new file mode 100644 index 0000000..696aec7 --- /dev/null +++ b/complete-application/src/components/LoginLink.tsx @@ -0,0 +1,19 @@ +'use client'; + +import { signIn } from 'next-auth/react'; + +export default function LoginButton({ session }: { session: any }) { + return ( + <> +

+ To get started,{' '} + signIn()} + style={{ textDecoration: 'underline', cursor: 'pointer' }} + > + log in or create a new account. + +

+ + ); +}