Skip to content

Commit 8dadd6a

Browse files
committed
Fix redirect authenticated users to dashboard
Fixes #405
1 parent a2df395 commit 8dadd6a

File tree

1 file changed

+2
-88
lines changed

1 file changed

+2
-88
lines changed

src/app/page.tsx

+2-88
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,5 @@
1-
import Image from 'next/image'
2-
import { Inter } from '@next/font/google'
3-
import styles from './page.module.css'
4-
import Link from 'next/link';
5-
6-
const inter = Inter({ subsets: ['latin'] })
1+
import { redirect, RedirectType } from 'next/navigation';
72

83
export default function Home() {
9-
return (
10-
<main className={styles.main}>
11-
<div className={styles.description}>
12-
<p>
13-
Get started by editing&nbsp;
14-
<code className={styles.code}>src/app/page.tsx</code>
15-
</p>
16-
<div>
17-
<a
18-
href="https://vercel.com?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
19-
target="_blank"
20-
rel="noopener noreferrer"
21-
>
22-
By{' '}
23-
<Image
24-
src="/vercel.svg"
25-
alt="Vercel Logo"
26-
className={styles.vercelLogo}
27-
width={100}
28-
height={24}
29-
priority
30-
/>
31-
</a>
32-
</div>
33-
</div>
34-
<Link href="/dashboard">Go to Dashboard</Link>
35-
<div className={styles.center}>
36-
<Image
37-
className={styles.logo}
38-
src="/next.svg"
39-
alt="Next.js Logo"
40-
width={180}
41-
height={37}
42-
priority
43-
/>
44-
<div className={styles.thirteen}>
45-
<Image src="/thirteen.svg" alt="13" width={40} height={31} priority />
46-
</div>
47-
</div>
48-
49-
<div className={styles.grid}>
50-
<a href="/dashboard"
51-
className={styles.card}
52-
target="_blank"
53-
rel="noopener noreferrer"
54-
>
55-
<h2 className={inter.className}>
56-
Docs <span>-&gt;</span>
57-
</h2>
58-
<p className={inter.className}>
59-
Find in-depth information about Next.js features and API.
60-
</p>
61-
</a>
62-
63-
<a
64-
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
65-
className={styles.card}
66-
target="_blank"
67-
rel="noopener noreferrer"
68-
>
69-
<h2 className={inter.className}>
70-
Templates <span>-&gt;</span>
71-
</h2>
72-
<p className={inter.className}>Explore the Next.js 13 playground.</p>
73-
</a>
74-
75-
<a
76-
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
77-
className={styles.card}
78-
target="_blank"
79-
rel="noopener noreferrer"
80-
>
81-
<h2 className={inter.className}>
82-
Deploy <span>-&gt;</span>
83-
</h2>
84-
<p className={inter.className}>
85-
Instantly deploy your Next.js site to a shareable URL with Vercel.
86-
</p>
87-
</a>
88-
</div>
89-
</main>
90-
)
4+
redirect('/dashboard')
915
}

0 commit comments

Comments
 (0)