From 77ca4775b1e55979cd1f7a58b663c2adbd81e879 Mon Sep 17 00:00:00 2001 From: smanylov Date: Mon, 12 Jan 2026 15:41:16 +0700 Subject: [PATCH] update token refresh function --- src/app/[locale]/pages/refferals/page.tsx | 2 ++ src/app/actions/auth.ts | 2 +- src/app/actions/session.ts | 5 +++-- src/app/ui/referral-page/referral-stats.tsx | 7 +++++++ 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 src/app/ui/referral-page/referral-stats.tsx diff --git a/src/app/[locale]/pages/refferals/page.tsx b/src/app/[locale]/pages/refferals/page.tsx index 27248b0..144e332 100644 --- a/src/app/[locale]/pages/refferals/page.tsx +++ b/src/app/[locale]/pages/refferals/page.tsx @@ -1,6 +1,7 @@ import { useTranslations } from 'next-intl'; import { Suspense } from 'react'; import PageTitle from '@/app/ui/page-title'; +import ReferralStats from '@/app/ui/referral-page/referral-stats'; export default function Page() { const t = useTranslations('Global'); @@ -9,6 +10,7 @@ export default function Page() { ...}> +
refferals
diff --git a/src/app/actions/auth.ts b/src/app/actions/auth.ts index 71650be..391662e 100644 --- a/src/app/actions/auth.ts +++ b/src/app/actions/auth.ts @@ -301,7 +301,7 @@ export async function tokenLifeExtension() { const parsed = await response.json(); console.log('tokenLifeExtension'); console.log(parsed.message_code); - updateSession(); + await updateSession(); } } catch (error) { await deleteSession(); diff --git a/src/app/actions/session.ts b/src/app/actions/session.ts index 8072506..19b97b5 100644 --- a/src/app/actions/session.ts +++ b/src/app/actions/session.ts @@ -1,7 +1,8 @@ -import 'server-only' +'use server'; + +/* import 'server-only'; */ import { cookies } from 'next/headers' import { SignJWT, jwtVerify } from 'jose' -/* import { SessionPayload } from '@/app/lib/definitions' */ /* const secretKey = process.env.SESSION_SECRET */ const secretKey = 'AAA+sq1yKte/gMgUUu/B/OyXqr45/LMYplPVOlWc+uo=' diff --git a/src/app/ui/referral-page/referral-stats.tsx b/src/app/ui/referral-page/referral-stats.tsx new file mode 100644 index 0000000..c8e5370 --- /dev/null +++ b/src/app/ui/referral-page/referral-stats.tsx @@ -0,0 +1,7 @@ +export default function ReferralStats() { + return ( +
+ test +
+ ) +} \ No newline at end of file