Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🐛 Fix session update (#1601)

Luke Vellab6fc95b03b80
diff --git a/apps/web/src/next-auth.ts b/apps/web/src/next-auth.ts
index 0f24e154f..1b6588ddb 100644
--- a/apps/web/src/next-auth.ts
+++ b/apps/web/src/next-auth.ts
@@ -137,8 +137,8 @@ const {
return true;
},
- async jwt({ token, session, trigger }) {
- if (trigger === "update") {
+ async jwt({ token, session }) {
+ if (session) {
const parsed = sessionUpdateSchema.safeParse(session);
if (parsed.success) {
Object.entries(parsed.data).forEach(([key, value]) => {
@@ -163,12 +163,14 @@ const {
timeFormat: true,
timeZone: true,
weekStart: true,
+ image: true,
},
});
if (user) {
token.name = user.name;
token.email = user.email;
+ token.picture = user.image;
token.locale = user.locale;
token.timeFormat = user.timeFormat;
token.timeZone = user.timeZone;