@tomei/sso 0.28.3 → 0.28.4

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": "@tomei/sso",
3
- "version": "0.28.3",
3
+ "version": "0.28.4",
4
4
  "description": "Tomei SSO Package",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -296,6 +296,7 @@ export class LoginUser extends LoginUserBase {
296
296
  model: Staff,
297
297
  },
298
298
  ],
299
+ transaction: dbTransaction,
299
300
  });
300
301
 
301
302
  if (!user) {
@@ -583,14 +584,16 @@ export class LoginUser extends LoginUserBase {
583
584
 
584
585
  return `${this.UserId}:${sessionId}`;
585
586
  } catch (error) {
586
- await LoginUser._LoginHistoryRepository.create({
587
- UserId: this.UserId,
588
- SystemCode: systemCode,
589
- OriginIp: ipAddress,
590
- LoginStatus: LoginStatusEnum.FAILURE,
591
- CreatedAt: new Date(),
592
- dbTransaction,
593
- });
587
+ if (this.ObjectId) {
588
+ await LoginUser._LoginHistoryRepository.create({
589
+ UserId: this.UserId,
590
+ SystemCode: systemCode,
591
+ OriginIp: ipAddress,
592
+ LoginStatus: LoginStatusEnum.FAILURE,
593
+ CreatedAt: new Date(),
594
+ dbTransaction,
595
+ });
596
+ }
594
597
  throw error;
595
598
  }
596
599
  }