rez_core 2.0.9 → 2.0.11

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "2.0.9",
3
+ "version": "2.0.11",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -11,32 +11,32 @@ import { ConfigService } from '@nestjs/config';
11
11
  export class JwtStrategy extends PassportStrategy(Strategy) {
12
12
  constructor(
13
13
  @InjectRepository(UserSession)
14
- private userSessionRepository: Repository<UserSession>,
14
+ // private userSessionRepository: Repository<UserSession>,
15
15
  private configService: ConfigService,
16
16
  ) {
17
17
  super({
18
18
  jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
19
19
  ignoreExpiration: false,
20
- secretOrKey:configService.get('SECRET_KEY'),
20
+ secretOrKey: configService.get('SECRET_KEY'),
21
21
  });
22
22
  }
23
23
 
24
24
  async validate(payload) {
25
- const { userId, sessionToken,appcode } = payload;
25
+ const { userId, sessionToken, appcode, email_id } = payload;
26
26
 
27
27
  // Check if session exists and is valid
28
- const userSession = await this.userSessionRepository.findOne({
29
- where: { session_key: sessionToken },
30
- });
28
+ // const userSession = await this.userSessionRepository.findOne({
29
+ // where: { session_key: sessionToken },
30
+ // });
31
31
 
32
- if (
33
- !userSession ||
34
- userSession.is_session_loggedout ||
35
- new Date(userSession.expiry_date) < new Date()
36
- ) {
37
- throw new UnauthorizedException('Invalid or expired session');
38
- }
32
+ // if (
33
+ // !userSession ||
34
+ // userSession.is_session_loggedout ||
35
+ // new Date(userSession.expiry_date) < new Date()
36
+ // ) {
37
+ // throw new UnauthorizedException('Invalid or expired session');
38
+ // }
39
39
 
40
- return { userId, sessionToken ,appcode};
40
+ return { userId, sessionToken, appcode, email_id };
41
41
  }
42
42
  }
@@ -9,8 +9,6 @@ export class PreferenceMaster extends BaseEntity {
9
9
  this.entity_type = ENTITYTYPE_PREFERENCEMASTER;
10
10
  }
11
11
 
12
-
13
-
14
12
  @Column({
15
13
  name: 'display_name',
16
14
  type: 'varchar',
@@ -28,7 +28,12 @@ export class UserSessionService {
28
28
 
29
29
  await this.userSessionRepository.saveSession(userSession);
30
30
 
31
- const payload = { userId: user.id, sessionToken, appcode: appcode };
31
+ const payload = {
32
+ userId: user.id,
33
+ sessionToken,
34
+ appcode: appcode,
35
+ email_id: user.email_id,
36
+ };
32
37
  const accessToken = this.jwtAuthService.generateJwt(payload);
33
38
 
34
39
  userSession.access_token = accessToken;