-
The hook
export declare type SessionContextValue<R extends boolean = false> = R extends true ? {
data: Session;
status: "authenticated";
} | {
data: null;
status: "loading";
} : {
data: Session;
status: "authenticated";
} | {
data: null;
status: "unauthenticated" | "loading";
};
export interface Session extends Record<string, unknown>, DefaultSession {
}
export interface DefaultSession extends Record<string, unknown> {
user?: {
name?: string | null;
email?: string | null;
image?: string | null;
};
expires: ISODateString;
} |
Beta Was this translation helpful? Give feedback.
Answered by
flacial
Mar 10, 2022
Replies: 1 comment
-
This worked but we'll have to specify the type every time: interface Session extends DefaultSession {
lessonStatus: {
starGiven: string
passedAt: Date | null
lessonId: number
}[]
user: {
id: number
username: string
name: string
isAdmin: boolean
isConnectedToDiscord: boolean
}
submissions: Submission[]
}
export declare type SessionContext<R extends boolean = false> = R extends true
?
| {
data: Session
status: 'authenticated'
}
| {
data: null
status: 'loading'
}
:
| {
data: Session
status: 'authenticated'
}
| {
data: null
status: 'unauthenticated' | 'loading'
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
flacial
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This worked but we'll have to specify the type every time: