fixes prefill adding name in session and jwt (#2167)
This commit is contained in:
		
							parent
							
								
									e21813ba96
								
							
						
					
					
						commit
						e94594d0b1
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		| 
						 | 
					@ -181,6 +181,7 @@ export default NextAuth({
 | 
				
			||||||
      if (account && account.type === "credentials") {
 | 
					      if (account && account.type === "credentials") {
 | 
				
			||||||
        return {
 | 
					        return {
 | 
				
			||||||
          id: user.id,
 | 
					          id: user.id,
 | 
				
			||||||
 | 
					          name: user.name,
 | 
				
			||||||
          username: user.username,
 | 
					          username: user.username,
 | 
				
			||||||
          email: user.email,
 | 
					          email: user.email,
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
| 
						 | 
					@ -213,6 +214,7 @@ export default NextAuth({
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return {
 | 
					        return {
 | 
				
			||||||
          id: existingUser.id,
 | 
					          id: existingUser.id,
 | 
				
			||||||
 | 
					          name: existingUser.name,
 | 
				
			||||||
          username: existingUser.username,
 | 
					          username: existingUser.username,
 | 
				
			||||||
          email: existingUser.email,
 | 
					          email: existingUser.email,
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
| 
						 | 
					@ -226,6 +228,7 @@ export default NextAuth({
 | 
				
			||||||
        user: {
 | 
					        user: {
 | 
				
			||||||
          ...session.user,
 | 
					          ...session.user,
 | 
				
			||||||
          id: token.id as number,
 | 
					          id: token.id as number,
 | 
				
			||||||
 | 
					          name: token.name,
 | 
				
			||||||
          username: token.username as string,
 | 
					          username: token.username as string,
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
      };
 | 
					      };
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue