Skip to content

Commit

Permalink
➖ [#2]Del: 네이버 로그인 코드 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
labyrinth30 committed Jun 27, 2024
1 parent de67eab commit efb433a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 89 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"passport": "^0.7.0",
"passport-jwt": "^4.0.1",
"passport-local": "^1.0.0",
"passport-naver-v2": "^2.0.8",
"pg": "^8.12.0",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.8.1",
Expand Down
31 changes: 10 additions & 21 deletions src/auth/auth.controller.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@

import { Body, Controller, Post, Headers, UseGuards } from '@nestjs/common';
import { AuthService } from './auth.service';
import { BasicTokenGuard } from './guard/basic-token.guard';
import { AccessTokenGuard, RefreshTokenGuard } from './guard/bearer-token.guard';
import { RefreshTokenGuard } from './guard/bearer-token.guard';
import { RegisterUserDto } from './dto/register-user.dto';

@Controller('auth')
Expand All @@ -11,40 +10,34 @@ export class AuthController {

@Post('token/access')
@UseGuards(RefreshTokenGuard)
postTokenAccess(
@Headers('authorization') rawToken: string,
){
postTokenAccess(@Headers('authorization') rawToken: string) {
const token = this.authService.extractTokenFromHeader(rawToken, true);
const newToken = this.authService.rotateToken(token, false,);
const newToken = this.authService.rotateToken(token, false);
/**
* {accessToken: {token}}
*/
return {
accessToken: newToken,
}
};
}

@Post('token/refresh')
@UseGuards(RefreshTokenGuard)
postTokenRefresh(
@Headers('authorization') rawToken: string,
){
postTokenRefresh(@Headers('authorization') rawToken: string) {
const token = this.authService.extractTokenFromHeader(rawToken, true);
const newToken = this.authService.rotateToken(token, true,);
const newToken = this.authService.rotateToken(token, true);
/**
* {refreshToken: {token}}
*/
return {
refreshToken: newToken,
}
};
}

// 로그인
@Post('login/email')
@UseGuards(BasicTokenGuard)
postLoginEmail(
@Headers('authorization') rawToken: string,
) {
postLoginEmail(@Headers('authorization') rawToken: string) {
const token = this.authService.extractTokenFromHeader(rawToken, false);

const credentials = this.authService.decodeBasicToken(token);
Expand All @@ -53,11 +46,7 @@ export class AuthController {

// 회원가입
@Post('register/email')
postRegisterEmail(
@Body() body: RegisterUserDto,
) {
return this.authService.registerWithEmail(
body,
);
postRegisterEmail(@Body() body: RegisterUserDto) {
return this.authService.registerWithEmail(body);
}
}
23 changes: 0 additions & 23 deletions src/auth/guard/naver-auth-guard.ts

This file was deleted.

44 changes: 0 additions & 44 deletions src/auth/strategy/naver.strategy.ts

This file was deleted.

0 comments on commit efb433a

Please sign in to comment.