From b006b07e639d630aaef6000e5b9de54b92e54334 Mon Sep 17 00:00:00 2001 From: LucasDLTG Date: Wed, 6 May 2026 10:43:31 +0200 Subject: [PATCH] fix: auth token refresh --- .gitignore | 2 + README.md | 2 + src/app/[locale]/layout.tsx | 15 +- src/app/providers.tsx | 2 +- src/components/SessionGuard.tsx | 30 +++ src/components/{spinner.tsx => Spinner.tsx} | 0 src/lib/auth.ts | 222 ++++++++++++++------ 7 files changed, 198 insertions(+), 75 deletions(-) create mode 100644 src/components/SessionGuard.tsx rename src/components/{spinner.tsx => Spinner.tsx} (100%) diff --git a/.gitignore b/.gitignore index fb7ac70..bbbc91b 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,5 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts + +src/app/api/auth/debug diff --git a/README.md b/README.md index b9d35b4..8fe906c 100644 --- a/README.md +++ b/README.md @@ -145,3 +145,5 @@ git tag -d v1.0.0; git push origin :refs/tags/v1.0.0; git tag -a v1.0.0 -m "Rele - No error when streaming with too large model - Translations - When user stop generation, forward it to server +- Message UI +- UX (eg keep focus when press enter) diff --git a/src/app/[locale]/layout.tsx b/src/app/[locale]/layout.tsx index b21d475..81724b1 100644 --- a/src/app/[locale]/layout.tsx +++ b/src/app/[locale]/layout.tsx @@ -7,8 +7,9 @@ import { routing } from '@/i18n/routing'; import { getMessages } from 'next-intl/server'; import { Providers } from '../providers'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/lib/auth'; import { cookies } from 'next/headers'; +import { authOptions } from '@/lib/auth'; +import SessionGuard from '@/components/SessionGuard'; export const metadata = { title: 'Iceberg template', @@ -42,13 +43,15 @@ export default async function RootLayout(props: { - + + -
- {props.children} -
+
+ {props.children} +
-