fix: check for session on LoyaltyPage DynamicContent
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { serverClient } from "@/lib/trpc/server"
|
||||
|
||||
import { auth } from "@/auth"
|
||||
import Link from "@/components/TempDesignSystem/Link"
|
||||
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
||||
import Title from "@/components/TempDesignSystem/Text/Title"
|
||||
@@ -17,7 +18,9 @@ import type {
|
||||
import { LoyaltyComponentEnum } from "@/types/components/loyalty/enums"
|
||||
|
||||
async function DynamicComponentBlock({ component }: DynamicComponentProps) {
|
||||
const user = await serverClient().user.get()
|
||||
const session = await auth()
|
||||
|
||||
const user = session ? await serverClient().user.get() : null
|
||||
|
||||
switch (component) {
|
||||
case LoyaltyComponentEnum.how_it_works:
|
||||
|
||||
@@ -36,7 +36,7 @@ type OverviewTableTitleTranslation = {
|
||||
|
||||
export type OverviewTableTitleProps = { texts: OverviewTableTitleTranslation[] }
|
||||
|
||||
export type OverviewTableProps = { user?: User }
|
||||
export type OverviewTableProps = { user: User | null }
|
||||
|
||||
export type Level = {
|
||||
tier: membershipLevels
|
||||
|
||||
Reference in New Issue
Block a user