Skip to content

Commit

Permalink
✨ feat: auth 쓸데 없는 async await 키워드 제거 (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
yanggwangseong committed Dec 6, 2024
1 parent 3438834 commit 95ecdac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/controllers/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,29 @@ export class AuthController {
@IsPublicDecorator(IsPublicEnum.PUBLIC)
@UseGuards(BasicTokenGuard)
@Post("sign-in")
async signIn(@Headers("authorization") rawToken: string) {
signIn(@Headers("authorization") rawToken: string) {
const token = this.authService.extractTokenFromHeader(rawToken, false);

const decoded = this.authService.decodeBasicToken(token);

return await this.authService.signInByEmail(decoded);
return this.authService.signInByEmail(decoded);
}

@IsPublicDecorator(IsPublicEnum.PUBLIC)
@Post("sign-up")
async signUp(@Body() dto: RegisterMemberDto) {
return await this.authService.registerByEmail(dto);
signUp(@Body() dto: RegisterMemberDto) {
return this.authService.registerByEmail(dto);
}

@Post("sign-out")
signOut(@CurrentMemberDecorator("id") memberId: number) {
void this.authService.updateRefreshToken(memberId);
return this.authService.updateRefreshToken(memberId);
}

@IsPublicDecorator(IsPublicEnum.PUBLIC)
@Post("verify-email")
async verifyEmail(@Body() dto: VerifyEmailDto) {
return await this.authService.verifyEmail(dto);
verifyEmail(@Body() dto: VerifyEmailDto) {
return this.authService.verifyEmail(dto);
}

@IsPublicDecorator(IsPublicEnum.REFRESH)
Expand Down
2 changes: 1 addition & 1 deletion src/services/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class AuthService {
verificationCode,
);

void this.mailsService.sendVerificationEmail(
await this.mailsService.sendVerificationEmail(
newMember.email,
verificationCode,
);
Expand Down

0 comments on commit 95ecdac

Please sign in to comment.