-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/196-list-view-filtering
- Loading branch information
Showing
20 changed files
with
444 additions
and
31 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { Injectable, BadRequestException } from "@nestjs/common"; | ||
import { PassportStrategy } from "@nestjs/passport"; | ||
import { Profile, Strategy } from "passport-naver-v2"; | ||
import { User } from "../users.entity"; | ||
import { providerEnum } from "src/utils/enum"; | ||
|
||
@Injectable() | ||
export class NaverOAuthStrategy extends PassportStrategy(Strategy, "naver") { | ||
constructor() { | ||
super({ | ||
clientID: process.env.NAVER_CLIENT_ID, | ||
clientSecret: process.env.NAVER_CLIENT_PASS, | ||
callbackURL: `${process.env.BACKEND_URL}/auth/naver/callback`, | ||
}); | ||
} | ||
|
||
async validate( | ||
accessToken: string, | ||
refreshToken: string, | ||
profile: Profile, | ||
): Promise<User> { | ||
try { | ||
const { email, id, nickname } = profile; | ||
const user = new User(); | ||
|
||
user.email = email; | ||
user.userId = id + "*naver"; | ||
user.nickname = nickname; | ||
user.password = "naver"; | ||
user.provider = providerEnum.NAVER; | ||
|
||
return user; | ||
} catch (error) { | ||
throw new BadRequestException( | ||
`네이버 로그인 중 오류가 발생했습니다 : ${error.message}`, | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export class ShapeInfoDto { | ||
uuid: number; | ||
count: number; | ||
} | ||
|
||
export class StatShapeDto { | ||
[key: string]: ({ rank: number } & ShapeInfoDto) | {}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
import { sentimentStatus } from "src/utils/enum"; | ||
|
||
export class TagInfoDto { | ||
id: number; | ||
count: number; | ||
tag: string; | ||
} | ||
|
||
export class DiariesInfoDto { | ||
sentiment: sentimentStatus; | ||
date: Date; | ||
} | ||
|
||
export class StatTagDto { | ||
[key: string]: ({ rank: number } & TagInfoDto) | {}; | ||
} | ||
|
||
export class DiariesDateDto { | ||
[dateString: string]: { sentiment: sentimentStatus; count: Number }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.