Next.js sample application that integrates with the mock SSO service: redirects to sso-mock for login, receives the one-time sso_code on its /callback route, and exchanges it for user info to establish a session. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
19 lines
380 B
TypeScript
19 lines
380 B
TypeScript
import { cookies } from 'next/headers'
|
|
import DashboardPage from './DashboardPage'
|
|
|
|
export default async function Home() {
|
|
const cookieStore = await cookies()
|
|
const userCookie = cookieStore.get('user')?.value
|
|
|
|
let user = null
|
|
if (userCookie) {
|
|
try {
|
|
user = JSON.parse(userCookie)
|
|
} catch {
|
|
// ignore
|
|
}
|
|
}
|
|
|
|
return <DashboardPage user={user} />
|
|
}
|