mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-01 03:06:32 +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 {
|
return {
|
||||||
id: session.user.id,
|
id: session.user.id,
|
||||||
isGuest: session.user.email === null,
|
isGuest: session.user.email === null,
|
||||||
|
locale: session.user.locale ?? undefined,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
posthogClient: posthog || undefined,
|
posthogClient: posthog || undefined,
|
||||||
|
|
|
@ -6,6 +6,7 @@ import type { PostHog } from "posthog-node";
|
||||||
export type GetUserFn = (opts: CreateNextContextOptions) => Promise<{
|
export type GetUserFn = (opts: CreateNextContextOptions) => Promise<{
|
||||||
id: string;
|
id: string;
|
||||||
isGuest: boolean;
|
isGuest: boolean;
|
||||||
|
locale?: string;
|
||||||
} | null>;
|
} | null>;
|
||||||
|
|
||||||
export interface TRPCContextParams {
|
export interface TRPCContextParams {
|
||||||
|
|
Loading…
Add table
Reference in a new issue