fix: add firstName and lastName to user model (#473)
* fix: add firstname and lastanme to user model * fix: avoid undefined in displayName resolve field * fix: user firstName and lastName instead of firstname lastname * fix: person table proper naming firstName lastName * fix: migrate front with firstName and lastName * fix: make front-graphql-generate not working
This commit is contained in:
@ -10,7 +10,6 @@ import { AuthGuard } from '@nestjs/passport';
|
||||
import { Response } from 'express';
|
||||
import { GoogleRequest } from '../strategies/google.auth.strategy';
|
||||
import { UserService } from '../../user/user.service';
|
||||
import { assertNotNull } from 'src/utils/assert';
|
||||
import { TokenService } from '../services/token.service';
|
||||
|
||||
@Controller('auth/google')
|
||||
@ -31,12 +30,12 @@ export class GoogleAuthController {
|
||||
@UseGuards(AuthGuard('google'))
|
||||
async googleAuthRedirect(@Req() req: GoogleRequest, @Res() res: Response) {
|
||||
const { firstName, lastName, email } = req.user;
|
||||
const displayName = [firstName, lastName].filter(assertNotNull).join(' ');
|
||||
|
||||
const user = await this.userService.createUser({
|
||||
data: {
|
||||
email,
|
||||
displayName,
|
||||
firstName: firstName ?? '',
|
||||
lastName: lastName ?? '',
|
||||
locale: 'en',
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user