minor changes

This commit is contained in:
Ephraim Atta-Duncan
2023-07-08 08:56:34 +00:00
parent d1bc948f3c
commit 3af26291c9

View File

@ -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;