Next.js + Mantine mock SSO service providing account/password, phone verify-code, and Feishu QR login. Issues a one-time sso_code that the external app exchanges for user info. Includes: - Feishu callback fix: guard against duplicate/concurrent /api/login submissions of the same single-use authorization code (feishuLogin once-guard + memoized onLoginSuccess to stop effect re-fire). - ADAPTATION_GUIDE.md: how to switch from the in-memory code store to the real backend auth/index + inner_get_user_info endpoints. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
38 lines
882 B
TypeScript
38 lines
882 B
TypeScript
import type { Metadata } from 'next'
|
|
import {
|
|
ColorSchemeScript,
|
|
MantineProvider,
|
|
mantineHtmlProps,
|
|
} from '@mantine/core'
|
|
import { Notifications } from '@mantine/notifications'
|
|
import { theme } from './theme'
|
|
import './globals.css'
|
|
import '@mantine/core/styles.css'
|
|
import '@mantine/core/styles.layer.css'
|
|
import '@mantine/notifications/styles.css'
|
|
|
|
export const metadata: Metadata = {
|
|
title: 'Mock SSO',
|
|
description: 'Mock SSO Login Provider',
|
|
}
|
|
|
|
export default function RootLayout({
|
|
children,
|
|
}: Readonly<{
|
|
children: React.ReactNode
|
|
}>) {
|
|
return (
|
|
<html lang="zh" {...mantineHtmlProps}>
|
|
<head>
|
|
<ColorSchemeScript defaultColorScheme="light" />
|
|
</head>
|
|
<body>
|
|
<MantineProvider defaultColorScheme="light" theme={theme}>
|
|
<Notifications />
|
|
{children}
|
|
</MantineProvider>
|
|
</body>
|
|
</html>
|
|
)
|
|
}
|