From e94594d0b1dd43383367479746cd3401fa679615 Mon Sep 17 00:00:00 2001 From: Agusti Fernandez Date: Wed, 16 Mar 2022 16:11:21 +0100 Subject: [PATCH] fixes prefill adding name in session and jwt (#2167) --- apps/web/pages/api/auth/[...nextauth].tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/web/pages/api/auth/[...nextauth].tsx b/apps/web/pages/api/auth/[...nextauth].tsx index 0a72c98e06..e2ca2f0854 100644 --- a/apps/web/pages/api/auth/[...nextauth].tsx +++ b/apps/web/pages/api/auth/[...nextauth].tsx @@ -181,6 +181,7 @@ export default NextAuth({ if (account && account.type === "credentials") { return { id: user.id, + name: user.name, username: user.username, email: user.email, }; @@ -213,6 +214,7 @@ export default NextAuth({ return { id: existingUser.id, + name: existingUser.name, username: existingUser.username, email: existingUser.email, }; @@ -226,6 +228,7 @@ export default NextAuth({ user: { ...session.user, id: token.id as number, + name: token.name, username: token.username as string, }, };