mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-11 21:12:16 +00:00
add suspense
This commit is contained in:
@@ -46,7 +46,7 @@
|
||||
"deepmerge": "^4.3.1",
|
||||
"moment": "^2.29.4",
|
||||
"next": "15.0.4-canary.23",
|
||||
"next-intl": "^3.20.0",
|
||||
"next-intl": "^3.25.1",
|
||||
"next-themes": "^0.2.1",
|
||||
"nice-grpc": "2.0.1",
|
||||
"qrcode.react": "^3.1.0",
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import "@/styles/globals.scss";
|
||||
|
||||
import { LanguageProvider } from "@/components/language-provider";
|
||||
import { LanguageSwitcher } from "@/components/language-switcher";
|
||||
import { Theme } from "@/components/theme";
|
||||
import { ThemeProvider } from "@/components/theme-provider";
|
||||
import { Analytics } from "@vercel/analytics/react";
|
||||
import { NextIntlClientProvider } from "next-intl";
|
||||
import { getLocale, getMessages } from "next-intl/server";
|
||||
import { Lato } from "next/font/google";
|
||||
import { ReactNode } from "react";
|
||||
import { ReactNode, Suspense } from "react";
|
||||
|
||||
const lato = Lato({
|
||||
weight: ["400", "700", "900"],
|
||||
@@ -19,33 +18,28 @@ export default async function RootLayout({
|
||||
}: {
|
||||
children: ReactNode;
|
||||
}) {
|
||||
const locale = await getLocale();
|
||||
const messages = await getMessages();
|
||||
|
||||
return (
|
||||
<html
|
||||
lang={locale}
|
||||
className={`${lato.className}`}
|
||||
suppressHydrationWarning
|
||||
>
|
||||
<html className={`${lato.className}`} suppressHydrationWarning>
|
||||
<head />
|
||||
<body>
|
||||
<ThemeProvider>
|
||||
<NextIntlClientProvider messages={messages}>
|
||||
<div
|
||||
className={`relative min-h-screen bg-background-light-600 dark:bg-background-dark-600 flex flex-col justify-center`}
|
||||
>
|
||||
<div className="relative mx-auto max-w-[440px] py-8 w-full ">
|
||||
{children}
|
||||
<div className="flex flex-row justify-end py-4 items-center space-x-4">
|
||||
<LanguageSwitcher />
|
||||
<Theme />
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
<LanguageProvider>
|
||||
<div
|
||||
className={`relative min-h-screen bg-background-light-600 dark:bg-background-dark-600 flex flex-col justify-center`}
|
||||
>
|
||||
<div className="relative mx-auto max-w-[440px] py-8 w-full ">
|
||||
{children}
|
||||
<div className="flex flex-row justify-end py-4 items-center space-x-4">
|
||||
<LanguageSwitcher />
|
||||
<Theme />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Analytics />
|
||||
</NextIntlClientProvider>
|
||||
<Analytics />
|
||||
</LanguageProvider>
|
||||
</Suspense>
|
||||
</ThemeProvider>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
18
apps/login/src/components/language-provider.tsx
Normal file
18
apps/login/src/components/language-provider.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
"use cache";
|
||||
|
||||
import { NextIntlClientProvider } from "next-intl";
|
||||
import { getLocale, getMessages } from "next-intl/server";
|
||||
import { unstable_cacheLife as cacheLife } from "next/cache";
|
||||
import { ReactNode } from "react";
|
||||
|
||||
export async function LanguageProvider({ children }: { children: ReactNode }) {
|
||||
cacheLife("hours");
|
||||
|
||||
const locale = await getLocale();
|
||||
const messages = await getMessages();
|
||||
return (
|
||||
<NextIntlClientProvider messages={messages}>
|
||||
{children}
|
||||
</NextIntlClientProvider>
|
||||
);
|
||||
}
|
||||
@@ -66,6 +66,8 @@ export async function getBrandingSettings(organization?: string) {
|
||||
|
||||
export async function getLoginSettings(orgId?: string) {
|
||||
"use cache";
|
||||
cacheLife("hours");
|
||||
|
||||
return await settingsService
|
||||
.getLoginSettings({ ctx: makeReqCtx(orgId) }, {})
|
||||
.then((resp) => (resp.settings ? resp.settings : undefined));
|
||||
@@ -99,6 +101,8 @@ export async function registerTOTP(userId: string) {
|
||||
|
||||
export async function getGeneralSettings() {
|
||||
"use cache";
|
||||
cacheLife("hours");
|
||||
|
||||
return settingsService
|
||||
.getGeneralSettings({}, {})
|
||||
.then((resp) => resp.supportedLanguages);
|
||||
@@ -106,6 +110,8 @@ export async function getGeneralSettings() {
|
||||
|
||||
export async function getLegalAndSupportSettings(organization?: string) {
|
||||
"use cache";
|
||||
cacheLife("hours");
|
||||
|
||||
return settingsService
|
||||
.getLegalAndSupportSettings({ ctx: makeReqCtx(organization) }, {})
|
||||
.then((resp) => (resp.settings ? resp.settings : undefined));
|
||||
@@ -113,6 +119,8 @@ export async function getLegalAndSupportSettings(organization?: string) {
|
||||
|
||||
export async function getPasswordComplexitySettings(organization?: string) {
|
||||
"use cache";
|
||||
cacheLife("hours");
|
||||
|
||||
return settingsService
|
||||
.getPasswordComplexitySettings({ ctx: makeReqCtx(organization) })
|
||||
.then((resp) => (resp.settings ? resp.settings : undefined));
|
||||
|
||||
104
pnpm-lock.yaml
generated
104
pnpm-lock.yaml
generated
@@ -99,8 +99,8 @@ importers:
|
||||
specifier: 15.0.4-canary.23
|
||||
version: 15.0.4-canary.23(@babel/core@7.26.0)(@playwright/test@1.48.2)(react-dom@19.0.0-rc-66855b96-20241106(react@19.0.0-rc-66855b96-20241106))(react@19.0.0-rc-66855b96-20241106)(sass@1.80.7)
|
||||
next-intl:
|
||||
specifier: ^3.20.0
|
||||
version: 3.20.0(next@15.0.4-canary.23(@babel/core@7.26.0)(@playwright/test@1.48.2)(react-dom@19.0.0-rc-66855b96-20241106(react@19.0.0-rc-66855b96-20241106))(react@19.0.0-rc-66855b96-20241106)(sass@1.80.7))(react@19.0.0-rc-66855b96-20241106)
|
||||
specifier: ^3.25.1
|
||||
version: 3.25.1(next@15.0.4-canary.23(@babel/core@7.26.0)(@playwright/test@1.48.2)(react-dom@19.0.0-rc-66855b96-20241106(react@19.0.0-rc-66855b96-20241106))(react@19.0.0-rc-66855b96-20241106)(sass@1.80.7))(react@19.0.0-rc-66855b96-20241106)
|
||||
next-themes:
|
||||
specifier: ^0.2.1
|
||||
version: 0.2.1(next@15.0.4-canary.23(@babel/core@7.26.0)(@playwright/test@1.48.2)(react-dom@19.0.0-rc-66855b96-20241106(react@19.0.0-rc-66855b96-20241106))(react@19.0.0-rc-66855b96-20241106)(sass@1.80.7))(react-dom@19.0.0-rc-66855b96-20241106(react@19.0.0-rc-66855b96-20241106))(react@19.0.0-rc-66855b96-20241106)
|
||||
@@ -918,21 +918,24 @@ packages:
|
||||
'@floating-ui/utils@0.2.8':
|
||||
resolution: {integrity: sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig==}
|
||||
|
||||
'@formatjs/ecma402-abstract@2.1.0':
|
||||
resolution: {integrity: sha512-SE2V2PE03K9U/YQZ3nxEOysRkQ/CfSwLHR789Uk9N0PTiWT6I+17UTDI97zYEwC1mbnjefqmtjbL8nunjPwGjw==}
|
||||
'@formatjs/ecma402-abstract@2.2.4':
|
||||
resolution: {integrity: sha512-lFyiQDVvSbQOpU+WFd//ILolGj4UgA/qXrKeZxdV14uKiAUiPAtX6XAn7WBCRi7Mx6I7EybM9E5yYn4BIpZWYg==}
|
||||
|
||||
'@formatjs/fast-memoize@2.2.0':
|
||||
resolution: {integrity: sha512-hnk/nY8FyrL5YxwP9e4r9dqeM6cAbo8PeU9UjyXojZMNvVad2Z06FAVHyR3Ecw6fza+0GH7vdJgiKIVXTMbSBA==}
|
||||
'@formatjs/fast-memoize@2.2.3':
|
||||
resolution: {integrity: sha512-3jeJ+HyOfu8osl3GNSL4vVHUuWFXR03Iz9jjgI7RwjG6ysu/Ymdr0JRCPHfF5yGbTE6JCrd63EpvX1/WybYRbA==}
|
||||
|
||||
'@formatjs/icu-messageformat-parser@2.7.9':
|
||||
resolution: {integrity: sha512-9Z5buDRMsTbplXknvRlDmnpWhZrayNVcVvkH0+SSz8Ll4XD/7Tcn8m1IjxM3iBJSwQbxwxb7/g0Fkx3d4j2osw==}
|
||||
'@formatjs/icu-messageformat-parser@2.9.4':
|
||||
resolution: {integrity: sha512-Tbvp5a9IWuxUcpWNIW6GlMQYEc4rwNHR259uUFoKWNN1jM9obf9Ul0e+7r7MvFOBNcN+13K7NuKCKqQiAn1QEg==}
|
||||
|
||||
'@formatjs/icu-skeleton-parser@1.8.3':
|
||||
resolution: {integrity: sha512-TsKAP013ayZFbWWR2KWy+f9QVZh0yDFTPK3yE4OqU2gnzafvmKTodRtJLVpfZmpXWJ5y7BWD1AsyT14mcbLzig==}
|
||||
'@formatjs/icu-skeleton-parser@1.8.8':
|
||||
resolution: {integrity: sha512-vHwK3piXwamFcx5YQdCdJxUQ1WdTl6ANclt5xba5zLGDv5Bsur7qz8AD7BevaKxITwpgDeU0u8My3AIibW9ywA==}
|
||||
|
||||
'@formatjs/intl-localematcher@0.5.4':
|
||||
resolution: {integrity: sha512-zTwEpWOzZ2CiKcB93BLngUX59hQkuZjT2+SAQEscSm52peDW/getsawMcWF1rGRpMCX6D7nSJA3CzJ8gn13N/g==}
|
||||
|
||||
'@formatjs/intl-localematcher@0.5.8':
|
||||
resolution: {integrity: sha512-I+WDNWWJFZie+jkfkiK5Mp4hEDyRSEvmyfYadflOno/mmKJKcB17fEpEH0oJu/OWhhCJ8kJBDz2YMd/6cDl7Mg==}
|
||||
|
||||
'@grpc/grpc-js@1.11.1':
|
||||
resolution: {integrity: sha512-gyt/WayZrVPH2w/UTLansS7F9Nwld472JxxaETamrM8HNlsa+jSLNyKAZmhxI2Me4c3mQHFiS1wWHDY1g1Kthw==}
|
||||
engines: {node: '>=12.10.0'}
|
||||
@@ -2865,8 +2868,8 @@ packages:
|
||||
resolution: {integrity: sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
intl-messageformat@10.6.0:
|
||||
resolution: {integrity: sha512-AYKl/DY1nl75pJU8EK681JOVL40uQTNJe3yEMXKfydDFoz+5hNrM/PqjchueSMKGKCZKBVgeexqZwy3uC2B36Q==}
|
||||
intl-messageformat@10.7.7:
|
||||
resolution: {integrity: sha512-F134jIoeYMro/3I0h08D0Yt4N9o9pjddU/4IIxMMURqbAtI2wu70X8hvG1V48W49zXHXv3RKSF/po+0fDfsGjA==}
|
||||
|
||||
is-arguments@1.1.1:
|
||||
resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==}
|
||||
@@ -3361,15 +3364,15 @@ packages:
|
||||
natural-compare@1.4.0:
|
||||
resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}
|
||||
|
||||
negotiator@0.6.3:
|
||||
resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==}
|
||||
negotiator@1.0.0:
|
||||
resolution: {integrity: sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==}
|
||||
engines: {node: '>= 0.6'}
|
||||
|
||||
next-intl@3.20.0:
|
||||
resolution: {integrity: sha512-0bCZcc38HfAZk/T+PNNcnJZknC+caS5rBK+WYRd1HsOL5O6puEu2H3kya8oT9s8piHjrTf7P0UHeahOFleOnrw==}
|
||||
next-intl@3.25.1:
|
||||
resolution: {integrity: sha512-Z2dJWn5f/b1sb8EmuJcuDhbQTIp4RG1KBFAILgRt/y27W0ifU7Ll/os3liphUY4InyRH89uShTAk7ItAlpr0uA==}
|
||||
peerDependencies:
|
||||
next: ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0
|
||||
react: ^16.8.0 || ^17.0.0 || ^18.0.0
|
||||
next: ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0
|
||||
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0
|
||||
|
||||
next-themes@0.2.1:
|
||||
resolution: {integrity: sha512-B+AKNfYNIzh0vqQQKqQItTS8evEouKD7H5Hj3kmuPERwddR2TxvDSFZuTj6T7Jfn1oyeUyJMydPl1Bkxkh0W7A==}
|
||||
@@ -4393,6 +4396,9 @@ packages:
|
||||
tslib@2.7.0:
|
||||
resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==}
|
||||
|
||||
tslib@2.8.1:
|
||||
resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
|
||||
|
||||
tsup@8.3.5:
|
||||
resolution: {integrity: sha512-Tunf6r6m6tnZsG9GYWndg0z8dEV7fD733VBFzFJ5Vcm1FtlXB8xBD/rtrBi2a3YKEV7hHtxiZtW5EAVADoe1pA==}
|
||||
engines: {node: '>=18'}
|
||||
@@ -4531,10 +4537,10 @@ packages:
|
||||
uri-js@4.4.1:
|
||||
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
|
||||
|
||||
use-intl@3.20.0:
|
||||
resolution: {integrity: sha512-5WQs6yZVWI9K7vw3134P0bhKNp4mi8NbmqKOCuhD9nQUMTKdmpBXwjk62+axwvEbj4XrZxj4X93mQMLXU5ZsCg==}
|
||||
use-intl@3.25.1:
|
||||
resolution: {integrity: sha512-Xeyl0+BjlBf6fJr2h5W/CESZ2IQAH7jzXYK4c/ao+qR26jNPW3FXBLjg7eLRxdeI6QaLcYGLtH3WYhC9I0+6Yg==}
|
||||
peerDependencies:
|
||||
react: ^16.8.0 || ^17.0.0 || ^18.0.0
|
||||
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0
|
||||
|
||||
use-sync-external-store@1.2.2:
|
||||
resolution: {integrity: sha512-PElTlVMwpblvbNqQ82d2n6RjStvdSoNe9FG28kNfz3WiXilJm4DdNkEzRhCZuIDwY8U08WVihhGR5iRqAwfDiw==}
|
||||
@@ -5343,31 +5349,35 @@ snapshots:
|
||||
|
||||
'@floating-ui/utils@0.2.8': {}
|
||||
|
||||
'@formatjs/ecma402-abstract@2.1.0':
|
||||
'@formatjs/ecma402-abstract@2.2.4':
|
||||
dependencies:
|
||||
'@formatjs/fast-memoize': 2.2.0
|
||||
'@formatjs/intl-localematcher': 0.5.4
|
||||
tslib: 2.7.0
|
||||
'@formatjs/fast-memoize': 2.2.3
|
||||
'@formatjs/intl-localematcher': 0.5.8
|
||||
tslib: 2.8.1
|
||||
|
||||
'@formatjs/fast-memoize@2.2.0':
|
||||
'@formatjs/fast-memoize@2.2.3':
|
||||
dependencies:
|
||||
tslib: 2.7.0
|
||||
tslib: 2.8.1
|
||||
|
||||
'@formatjs/icu-messageformat-parser@2.7.9':
|
||||
'@formatjs/icu-messageformat-parser@2.9.4':
|
||||
dependencies:
|
||||
'@formatjs/ecma402-abstract': 2.1.0
|
||||
'@formatjs/icu-skeleton-parser': 1.8.3
|
||||
tslib: 2.7.0
|
||||
'@formatjs/ecma402-abstract': 2.2.4
|
||||
'@formatjs/icu-skeleton-parser': 1.8.8
|
||||
tslib: 2.8.1
|
||||
|
||||
'@formatjs/icu-skeleton-parser@1.8.3':
|
||||
'@formatjs/icu-skeleton-parser@1.8.8':
|
||||
dependencies:
|
||||
'@formatjs/ecma402-abstract': 2.1.0
|
||||
tslib: 2.7.0
|
||||
'@formatjs/ecma402-abstract': 2.2.4
|
||||
tslib: 2.8.1
|
||||
|
||||
'@formatjs/intl-localematcher@0.5.4':
|
||||
dependencies:
|
||||
tslib: 2.7.0
|
||||
|
||||
'@formatjs/intl-localematcher@0.5.8':
|
||||
dependencies:
|
||||
tslib: 2.8.1
|
||||
|
||||
'@grpc/grpc-js@1.11.1':
|
||||
dependencies:
|
||||
'@grpc/proto-loader': 0.7.13
|
||||
@@ -7524,12 +7534,12 @@ snapshots:
|
||||
hasown: 2.0.2
|
||||
side-channel: 1.0.6
|
||||
|
||||
intl-messageformat@10.6.0:
|
||||
intl-messageformat@10.7.7:
|
||||
dependencies:
|
||||
'@formatjs/ecma402-abstract': 2.1.0
|
||||
'@formatjs/fast-memoize': 2.2.0
|
||||
'@formatjs/icu-messageformat-parser': 2.7.9
|
||||
tslib: 2.7.0
|
||||
'@formatjs/ecma402-abstract': 2.2.4
|
||||
'@formatjs/fast-memoize': 2.2.3
|
||||
'@formatjs/icu-messageformat-parser': 2.9.4
|
||||
tslib: 2.8.1
|
||||
|
||||
is-arguments@1.1.1:
|
||||
dependencies:
|
||||
@@ -8005,15 +8015,15 @@ snapshots:
|
||||
|
||||
natural-compare@1.4.0: {}
|
||||
|
||||
negotiator@0.6.3: {}
|
||||
negotiator@1.0.0: {}
|
||||
|
||||
next-intl@3.20.0(next@15.0.4-canary.23(@babel/core@7.26.0)(@playwright/test@1.48.2)(react-dom@19.0.0-rc-66855b96-20241106(react@19.0.0-rc-66855b96-20241106))(react@19.0.0-rc-66855b96-20241106)(sass@1.80.7))(react@19.0.0-rc-66855b96-20241106):
|
||||
next-intl@3.25.1(next@15.0.4-canary.23(@babel/core@7.26.0)(@playwright/test@1.48.2)(react-dom@19.0.0-rc-66855b96-20241106(react@19.0.0-rc-66855b96-20241106))(react@19.0.0-rc-66855b96-20241106)(sass@1.80.7))(react@19.0.0-rc-66855b96-20241106):
|
||||
dependencies:
|
||||
'@formatjs/intl-localematcher': 0.5.4
|
||||
negotiator: 0.6.3
|
||||
negotiator: 1.0.0
|
||||
next: 15.0.4-canary.23(@babel/core@7.26.0)(@playwright/test@1.48.2)(react-dom@19.0.0-rc-66855b96-20241106(react@19.0.0-rc-66855b96-20241106))(react@19.0.0-rc-66855b96-20241106)(sass@1.80.7)
|
||||
react: 19.0.0-rc-66855b96-20241106
|
||||
use-intl: 3.20.0(react@19.0.0-rc-66855b96-20241106)
|
||||
use-intl: 3.25.1(react@19.0.0-rc-66855b96-20241106)
|
||||
|
||||
next-themes@0.2.1(next@15.0.4-canary.23(@babel/core@7.26.0)(@playwright/test@1.48.2)(react-dom@19.0.0-rc-66855b96-20241106(react@19.0.0-rc-66855b96-20241106))(react@19.0.0-rc-66855b96-20241106)(sass@1.80.7))(react-dom@19.0.0-rc-66855b96-20241106(react@19.0.0-rc-66855b96-20241106))(react@19.0.0-rc-66855b96-20241106):
|
||||
dependencies:
|
||||
@@ -9020,6 +9030,8 @@ snapshots:
|
||||
|
||||
tslib@2.7.0: {}
|
||||
|
||||
tslib@2.8.1: {}
|
||||
|
||||
tsup@8.3.5(jiti@1.21.6)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.5.0):
|
||||
dependencies:
|
||||
bundle-require: 5.0.0(esbuild@0.24.0)
|
||||
@@ -9165,10 +9177,10 @@ snapshots:
|
||||
dependencies:
|
||||
punycode: 2.3.1
|
||||
|
||||
use-intl@3.20.0(react@19.0.0-rc-66855b96-20241106):
|
||||
use-intl@3.25.1(react@19.0.0-rc-66855b96-20241106):
|
||||
dependencies:
|
||||
'@formatjs/fast-memoize': 2.2.0
|
||||
intl-messageformat: 10.6.0
|
||||
'@formatjs/fast-memoize': 2.2.3
|
||||
intl-messageformat: 10.7.7
|
||||
react: 19.0.0-rc-66855b96-20241106
|
||||
|
||||
use-sync-external-store@1.2.2(react@19.0.0-rc-66855b96-20241106):
|
||||
|
||||
Reference in New Issue
Block a user