@flusys/nestjs-auth 6.0.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -591,7 +591,10 @@ let AuthenticationService = class AuthenticationService {
591
591
  async refreshToken(refreshToken) {
592
592
  try {
593
593
  const payload = this.jwtService.verify(refreshToken, {
594
- secret: this.authConfig.getRefreshTokenSecret()
594
+ secret: this.authConfig.getRefreshTokenSecret(),
595
+ algorithms: [
596
+ 'HS256'
597
+ ]
595
598
  });
596
599
  if (await this.isTokenRevoked(payload.id, payload.iat)) {
597
600
  throw new _common.UnauthorizedException({
@@ -943,14 +946,16 @@ let AuthenticationService = class AuthenticationService {
943
946
  type: 'access'
944
947
  }, {
945
948
  secret: this.authConfig.getJwtSecret(),
946
- expiresIn: this.authConfig.getJwtExpiration()
949
+ expiresIn: this.authConfig.getJwtExpiration(),
950
+ algorithm: 'HS256'
947
951
  });
948
952
  const refreshToken = this.jwtService.sign({
949
953
  ...payload,
950
954
  type: 'refresh'
951
955
  }, {
952
956
  secret: this.authConfig.getRefreshTokenSecret(),
953
- expiresIn: this.authConfig.getRefreshTokenExpiration()
957
+ expiresIn: this.authConfig.getRefreshTokenExpiration(),
958
+ algorithm: 'HS256'
954
959
  });
955
960
  return {
956
961
  accessToken,
@@ -540,7 +540,10 @@ export class AuthenticationService {
540
540
  async refreshToken(refreshToken) {
541
541
  try {
542
542
  const payload = this.jwtService.verify(refreshToken, {
543
- secret: this.authConfig.getRefreshTokenSecret()
543
+ secret: this.authConfig.getRefreshTokenSecret(),
544
+ algorithms: [
545
+ 'HS256'
546
+ ]
544
547
  });
545
548
  if (await this.isTokenRevoked(payload.id, payload.iat)) {
546
549
  throw new UnauthorizedException({
@@ -892,14 +895,16 @@ export class AuthenticationService {
892
895
  type: 'access'
893
896
  }, {
894
897
  secret: this.authConfig.getJwtSecret(),
895
- expiresIn: this.authConfig.getJwtExpiration()
898
+ expiresIn: this.authConfig.getJwtExpiration(),
899
+ algorithm: 'HS256'
896
900
  });
897
901
  const refreshToken = this.jwtService.sign({
898
902
  ...payload,
899
903
  type: 'refresh'
900
904
  }, {
901
905
  secret: this.authConfig.getRefreshTokenSecret(),
902
- expiresIn: this.authConfig.getRefreshTokenExpiration()
906
+ expiresIn: this.authConfig.getRefreshTokenExpiration(),
907
+ algorithm: 'HS256'
903
908
  });
904
909
  return {
905
910
  accessToken,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flusys/nestjs-auth",
3
- "version": "6.0.0",
3
+ "version": "6.0.1",
4
4
  "description": "Authentication and authorization infrastructure for NestJS applications",
5
5
  "main": "cjs/index.js",
6
6
  "module": "fesm/index.js",
@@ -93,7 +93,7 @@
93
93
  "rxjs": "^7.8.0"
94
94
  },
95
95
  "dependencies": {
96
- "@flusys/nestjs-core": "6.0.0",
97
- "@flusys/nestjs-shared": "6.0.0"
96
+ "@flusys/nestjs-core": "6.0.1",
97
+ "@flusys/nestjs-shared": "6.0.1"
98
98
  }
99
99
  }