Page 418 - MDP2022-2
P. 418
}
return user;
}
}
src/auth/guards/local-auth.guard.ts
import { Injectable } from '@nestjs/common';
import { AuthGuard } from '@nestjs/passport';
@Injectable()
export class LocalAuthGuard extends AuthGuard('local') {}
src/auth/guards/auth/dto
import {
IsEmail,
IsNotEmpty,
IsString,
Matches,
MaxLength,
MinLength,
} from 'class-validator';
export class PostSignupDTO {
@IsNotEmpty()
@IsString()
userId: string;
@IsNotEmpty()
@IsString()
name: string;
@IsNotEmpty()
@IsString()
nickname: string;
@IsNotEmpty()
@IsEmail()
email: string;
@IsNotEmpty()
@MinLength(4)
@MaxLength(20)
password: string;
}