mirror of
https://github.com/lukevella/rallly.git
synced 2025-04-29 02:06:34 +02:00
✨ Add locale to user object in trpc context (#1268)
Signed-off-by: Luke Vella <me@lukevella.com>
This commit is contained in:
parent
06e356720a
commit
d4bd922ed3
2 changed files with 2 additions and 0 deletions
|
@ -39,6 +39,7 @@ const trpcApiHandler = createNextApiHandler<AppRouter>({
|
|||
return {
|
||||
id: session.user.id,
|
||||
isGuest: session.user.email === null,
|
||||
locale: session.user.locale ?? undefined,
|
||||
};
|
||||
},
|
||||
posthogClient: posthog || undefined,
|
||||
|
|
|
@ -6,6 +6,7 @@ import type { PostHog } from "posthog-node";
|
|||
export type GetUserFn = (opts: CreateNextContextOptions) => Promise<{
|
||||
id: string;
|
||||
isGuest: boolean;
|
||||
locale?: string;
|
||||
} | null>;
|
||||
|
||||
export interface TRPCContextParams {
|
||||
|
|
Loading…
Add table
Reference in a new issue