Skip to content

Commit

Permalink
fix login link
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-fusionauth committed Sep 16, 2023
1 parent dae6924 commit 6b83ed7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
5 changes: 2 additions & 3 deletions complete-application/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -17,8 +17,7 @@ export default async function Home() {
<div className="content-container">
<div style={{ marginBottom: '100px' }}>
<h1>Welcome to Changebank</h1>
<p>To get started</p>
<LoginButton session={session} />
<LoginLink session={session} />
</div>
</div>
<div style={{ width: '100%', maxWidth: 800 }}>
Expand Down
1 change: 0 additions & 1 deletion complete-application/src/components/LoginButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export default function LoginButton({ session }: { session: any }) {
}
return (
<>
Status: Not logged in <br />
<button className="button-lg" onClick={() => signIn()}>
Log in
</button>
Expand Down
19 changes: 19 additions & 0 deletions complete-application/src/components/LoginLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use client';

import { signIn } from 'next-auth/react';

export default function LoginButton({ session }: { session: any }) {
return (
<>
<p>
To get started,{' '}
<a
onClick={() => signIn()}
style={{ textDecoration: 'underline', cursor: 'pointer' }}
>
log in or create a new account.
</a>
</p>
</>
);
}

0 comments on commit 6b83ed7

Please sign in to comment.