Skip to content

Commit

Permalink
merge: #281 이메일 값 옵셔널 설정
Browse files Browse the repository at this point in the history
[refactor] 이메일 값 옵셔널 설정
  • Loading branch information
kmi0817 authored Dec 7, 2023
2 parents 36a16da + a85f60c commit 1c47991
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
14 changes: 1 addition & 13 deletions BE/src/app.controller.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
import {
Controller,
Get,
Param,
Post,
Render,
Res,
UploadedFile,
UseInterceptors,
} from '@nestjs/common';
import { Controller, Get, Param, Render, Res } from '@nestjs/common';
import { AppService } from './app.service';
import { StorageService } from './storage/storage.service';
import { FileInterceptor } from '@nestjs/platform-express';


@Controller()
export class AppController {
Expand Down
3 changes: 3 additions & 0 deletions BE/src/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ export class AuthService {

if (!user) {
const email = createAuthDto.email;
if (!email) {
throw new BadRequestException('이메일 정보가 누락되어있습니다.');
}
user = await this.usersService.createUser(appleId, email, ipAddress);
if (!user) {
throw new InternalServerErrorException();
Expand Down
15 changes: 12 additions & 3 deletions BE/src/auth/dto/create-auth-request.dto.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsEmail, IsString, MaxLength, MinLength } from 'class-validator';
import {
IsEmail,
IsOptional,
IsString,
MaxLength,
MinLength,
} from 'class-validator';

export class CreateAuthRequestDto {
@ApiProperty()
@IsString()
idToken: string;

@ApiProperty()
@ApiProperty({
required: false,
})
@IsEmail()
@MinLength(4)
@MaxLength(35)
email: string;
@IsOptional()
email?: string;
}

0 comments on commit 1c47991

Please sign in to comment.