Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Feature/update passport dependencies (#3433)

Thomas Kaul918d0b85d436
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bd747b1ddf..d16d329255 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,9 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
+- Upgraded `@nestjs/passport` from version `10.0.0` to `10.0.3`
- Upgraded `angular` from version `17.3.5` to `17.3.10`
- Upgraded `class-validator` from version `0.14.0` to `0.14.1`
- Upgraded `Nx` from version `19.0.2` to `19.0.5`
+- Upgraded `passport` from version `0.6.0` to `0.7.0`
+- Upgraded `passport-jwt` from version `4.0.0` to `4.0.1`
- Upgraded `prisma` from version `5.13.0` to `5.14.0`
## 2.82.0 - 2024-05-22
diff --git a/apps/api/src/app/auth/google.strategy.ts b/apps/api/src/app/auth/google.strategy.ts
index 4abc1105a0..4d024603bc 100644
--- a/apps/api/src/app/auth/google.strategy.ts
+++ b/apps/api/src/app/auth/google.strategy.ts
@@ -3,7 +3,7 @@ import { ConfigurationService } from '@ghostfolio/api/services/configuration/con
import { Injectable, Logger } from '@nestjs/common';
import { PassportStrategy } from '@nestjs/passport';
import { Provider } from '@prisma/client';
-import { Strategy } from 'passport-google-oauth20';
+import { Profile, Strategy } from 'passport-google-oauth20';
import { AuthService } from './auth.service';
@@ -11,7 +11,7 @@ import { AuthService } from './auth.service';
export class GoogleStrategy extends PassportStrategy(Strategy, 'google') {
public constructor(
private readonly authService: AuthService,
- readonly configurationService: ConfigurationService
+ private readonly configurationService: ConfigurationService
) {
super({
callbackURL: `${configurationService.get(
@@ -20,7 +20,7 @@ export class GoogleStrategy extends PassportStrategy(Strategy, 'google') {
clientID: configurationService.get('GOOGLE_CLIENT_ID'),
clientSecret: configurationService.get('GOOGLE_SECRET'),
passReqToCallback: true,
- scope: ['email', 'profile']
+ scope: ['profile']
});
}
@@ -28,20 +28,17 @@ export class GoogleStrategy extends PassportStrategy(Strategy, 'google') {
request: any,
token: string,
refreshToken: string,
- profile,
+ profile: Profile,
done: Function,
done2: Function
) {
try {
- const jwt: string = await this.authService.validateOAuthLogin({
+ const jwt = await this.authService.validateOAuthLogin({
provider: Provider.GOOGLE,
thirdPartyId: profile.id
});
- const user = {
- jwt
- };
- done(null, user);
+ done(null, { jwt });
} catch (error) {
Logger.error(error, 'GoogleStrategy');
done(error, false);
diff --git a/package.json b/package.json
index cbb5ccc535..4f71ec9d23 100644
--- a/package.json
+++ b/package.json
@@ -80,7 +80,7 @@
"@nestjs/core": "10.1.3",
"@nestjs/event-emitter": "2.0.4",
"@nestjs/jwt": "10.1.0",
- "@nestjs/passport": "10.0.0",
+ "@nestjs/passport": "10.0.3",
"@nestjs/platform-express": "10.1.3",
"@nestjs/schedule": "3.0.2",
"@nestjs/serve-static": "4.0.0",
@@ -123,9 +123,9 @@
"ngx-skeleton-loader": "7.0.0",
"ngx-stripe": "15.5.0",
"papaparse": "5.3.1",
- "passport": "0.6.0",
+ "passport": "0.7.0",
"passport-google-oauth20": "2.0.0",
- "passport-jwt": "4.0.0",
+ "passport-jwt": "4.0.1",
"prisma": "5.14.0",
"reflect-metadata": "0.1.13",
"rxjs": "7.5.6",
@@ -175,7 +175,7 @@
"@types/lodash": "4.17.0",
"@types/node": "18.16.9",
"@types/papaparse": "5.3.7",
- "@types/passport-google-oauth20": "2.0.11",
+ "@types/passport-google-oauth20": "2.0.16",
"@typescript-eslint/eslint-plugin": "6.21.0",
"@typescript-eslint/parser": "6.21.0",
"codelyzer": "6.0.1",
diff --git a/yarn.lock b/yarn.lock
index 2a2eb91ab2..1793e42676 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4830,10 +4830,10 @@
"@types/jsonwebtoken" "9.0.2"
jsonwebtoken "9.0.0"
-"@nestjs/[email protected]":
- version "10.0.0"
- resolved "https://registry.yarnpkg.com/@nestjs/passport/-/passport-10.0.0.tgz#92d36d4b8796b373da3f4d1a055db03cb246b127"
- integrity sha512-IlKKc6M7JOe+4dBbW6gZsXBSD05ZYgwfGf3GJhgCmUGYVqffpDdALQSS6JftnExrE+12rACoEmHkzYwKAGVK0Q==
+"@nestjs/[email protected]":
+ version "10.0.3"
+ resolved "https://registry.yarnpkg.com/@nestjs/passport/-/passport-10.0.3.tgz#26ec5b2167d364e04962c115fcef80d10e185367"
+ integrity sha512-znJ9Y4S8ZDVY+j4doWAJ8EuuVO7SkQN3yOBmzxbGaXbvcSwFDAdGJ+OMCg52NdzIO4tQoN4pYKx8W6M0ArfFRQ==
"@nestjs/[email protected]":
version "10.1.3"
@@ -7470,10 +7470,10 @@
resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.1.tgz#27f7559836ad796cea31acb63163b203756a5b4e"
integrity sha512-3YmXzzPAdOTVljVMkTMBdBEvlOLg2cDQaDhnnhT3nT9uDbnJzjWhKlzb+desT12Y7tGqaN6d+AbozcKzyL36Ng==
- version "2.0.11"
- resolved "https://registry.yarnpkg.com/@types/passport-google-oauth20/-/passport-google-oauth20-2.0.11.tgz#271ec71de3030a3e1c004b24e633e4b298ccba97"
- integrity sha512-9XMT1GfwhZL7UQEiCepLef55RNPHkbrCtsU7rsWPTEOsmu5qVIW8nSemtB4p+P24CuOhA+IKkv8LsPThYghGww==
+ version "2.0.16"
+ resolved "https://registry.yarnpkg.com/@types/passport-google-oauth20/-/passport-google-oauth20-2.0.16.tgz#9e39c1203d56496d89392538e6109626e253bc28"
+ integrity sha512-ayXK2CJ7uVieqhYOc6k/pIr5pcQxOLB6kBev+QUGS7oEZeTgIs1odDobXRqgfBPvXzl0wXCQHftV5220czZCPA==
dependencies:
"@types/express" "*"
"@types/passport" "*"
@@ -14217,10 +14217,10 @@ [email protected]:
ms "^2.1.1"
semver "^7.3.8"
-jsonwebtoken@^8.2.0:
- version "8.5.1"
- resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz#00e71e0b8df54c2121a1f26137df2280673bcc0d"
- integrity sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==
+jsonwebtoken@^9.0.0:
+ version "9.0.2"
+ resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz#65ff91f4abef1784697d40952bb1998c504caaf3"
+ integrity sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==
dependencies:
jws "^3.2.2"
lodash.includes "^4.3.0"
@@ -14231,7 +14231,7 @@ jsonwebtoken@^8.2.0:
lodash.isstring "^4.0.1"
lodash.once "^4.0.0"
ms "^2.1.1"
- semver "^5.6.0"
+ semver "^7.5.4"
jsprim@^2.0.2:
version "2.0.2"
@@ -16110,12 +16110,12 @@ [email protected]:
dependencies:
passport-oauth2 "1.x.x"
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/passport-jwt/-/passport-jwt-4.0.0.tgz#7f0be7ba942e28b9f5d22c2ebbb8ce96ef7cf065"
- integrity sha512-BwC0n2GP/1hMVjR4QpnvqA61TxenUMlmfNjYNgK0ZAs0HK4SOQkHcSv4L328blNTLtHq7DbmvyNJiH+bn6C5Mg==
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/passport-jwt/-/passport-jwt-4.0.1.tgz#c443795eff322c38d173faa0a3c481479646ec3d"
+ integrity sha512-UCKMDYhNuGOBE9/9Ycuoyh7vP6jpeTp/+sfMJl7nLff/t6dps+iaeE0hhNkKN8/HZHcJ7lCdOyDxHdDoxoSvdQ==
dependencies:
- jsonwebtoken "^8.2.0"
+ jsonwebtoken "^9.0.0"
passport-strategy "^1.0.0"
@@ -16134,10 +16134,10 @@ [email protected], passport-strategy@^1.0.0:
resolved "https://registry.yarnpkg.com/passport-strategy/-/passport-strategy-1.0.0.tgz#b5539aa8fc225a3d1ad179476ddf236b440f52e4"
integrity sha512-CB97UUvDKJde2V0KDWWB3lyf6PC3FaZP7YxZ2G8OAtn9p4HI9j9JLP9qjOGZFvyl8uwNT8qM+hGnz/n16NI7oA==
- version "0.6.0"
- resolved "https://registry.yarnpkg.com/passport/-/passport-0.6.0.tgz#e869579fab465b5c0b291e841e6cc95c005fac9d"
- integrity sha512-0fe+p3ZnrWRW74fe8+SvCyf4a3Pb2/h7gFkQ8yTJpAO50gDzlfjZUZTO1k5Eg9kUct22OxHLqDZoKUWRHOh9ug==
+ version "0.7.0"
+ resolved "https://registry.yarnpkg.com/passport/-/passport-0.7.0.tgz#3688415a59a48cf8068417a8a8092d4492ca3a05"
+ integrity sha512-cPLl+qZpSc+ireUvt+IzqbED1cHHkDoVYMo30jbJIdOOjQ1MQYZBPiNvmi8UM6lJuOpTPXJGZQk0DtC4y61MYQ==
dependencies:
passport-strategy "1.x.x"
pause "0.0.1"