Use profile image from oauth provider (#1330)

This commit is contained in:
Luke Vella 2024-09-07 16:57:07 +01:00 committed by GitHub
parent be216344e2
commit 364bb8b83f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 95 additions and 29 deletions

View file

@ -21,6 +21,7 @@ const userSchema = z.object({
timeZone: z.string().nullish(),
timeFormat: z.enum(["hours12", "hours24"]).nullish(),
weekStart: z.number().min(0).max(6).nullish(),
image: z.string().nullish(),
});
export const UserContext = React.createContext<{
@ -76,9 +77,10 @@ export const UserProvider = (props: { children?: React.ReactNode }) => {
id: user.id as string,
name: user.name ?? t("guest"),
email: user.email || null,
isGuest: !user.email,
isGuest,
tier,
timeZone: user.timeZone ?? null,
image: user.image ?? null,
},
refresh: session.update,
ownsObject: ({ userId }) => {