mirror of
https://github.com/documenso/documenso.git
synced 2025-11-18 02:32:00 +10:00
minor changes
This commit is contained in:
@ -31,7 +31,6 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
|
|||||||
const user = await getUserByEmail({ email }).catch(() => null);
|
const user = await getUserByEmail({ email }).catch(() => null);
|
||||||
|
|
||||||
if (!user || !user.password) {
|
if (!user || !user.password) {
|
||||||
console.log('no user');
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,7 +41,7 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: String(user.id) as any,
|
id: String(user.id),
|
||||||
email: user.email,
|
email: user.email,
|
||||||
name: user.name,
|
name: user.name,
|
||||||
} satisfies User;
|
} satisfies User;
|
||||||
@ -57,6 +56,7 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
|
|||||||
id: profile.sub as any,
|
id: profile.sub as any,
|
||||||
name: profile.name,
|
name: profile.name,
|
||||||
email: profile.email,
|
email: profile.email,
|
||||||
|
image: profile.picture,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
@ -83,7 +83,6 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
async session({ token, session }) {
|
async session({ token, session }) {
|
||||||
console.log('session', { token, session });
|
|
||||||
if (token) {
|
if (token) {
|
||||||
const documensoSession = {
|
const documensoSession = {
|
||||||
...session,
|
...session,
|
||||||
@ -91,6 +90,7 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
|
|||||||
id: Number(token.id),
|
id: Number(token.id),
|
||||||
name: token.name,
|
name: token.name,
|
||||||
email: token.email,
|
email: token.email,
|
||||||
|
image: token.image,
|
||||||
},
|
},
|
||||||
} as Session;
|
} as Session;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user