diff --git a/apps/website/src/app/api/discord/route.ts b/apps/website/src/app/api/discord/route.ts
index a70562e82..e952e9c5d 100644
--- a/apps/website/src/app/api/discord/route.ts
+++ b/apps/website/src/app/api/discord/route.ts
@@ -4,12 +4,18 @@ const PRO_ROLE_ID = '990532440126808094'
import { NextRequest, NextResponse } from 'next/server'
-export const GET = async () => {
+export const GET = async (req: NextRequest) => {
+ const code = req.nextUrl.searchParams.get('code')
+
+ if (!code) {
+ return NextResponse.redirect(req.nextUrl.origin)
+ }
+
const supabase = createClient()
const {
data: { session },
- } = await supabase.auth.getSession()
+ } = await supabase.auth.exchangeCodeForSession(code)
if (!session) {
return NextResponse.json({
@@ -17,7 +23,7 @@ export const GET = async () => {
message: 'You need to be logged in.',
})
}
- console.log(session)
+
if (!session.provider_token) {
return NextResponse.json({
success: false,
diff --git a/apps/website/src/components/layout/navigation-menu.tsx b/apps/website/src/components/layout/navigation-menu.tsx
index c2499fa03..c61504d2b 100644
--- a/apps/website/src/components/layout/navigation-menu.tsx
+++ b/apps/website/src/components/layout/navigation-menu.tsx
@@ -402,6 +402,21 @@ export const Navigation = () => {
/>
+
+
+ }
+ borderRadius="md"
+ as={Link}
+ href="https://github.com/saas-js/saas-ui"
+ />
+
+
+
+
+
{isAuthenticated ? (