@tomei/sso 0.35.5 → 0.35.7

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomei/sso",
3
- "version": "0.35.5",
3
+ "version": "0.35.7",
4
4
  "description": "Tomei SSO Package",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1820,17 +1820,8 @@ export class User extends UserBase {
1820
1820
  return false;
1821
1821
  }
1822
1822
 
1823
- await User._Repository.update(
1824
- {
1825
- MFAEnabled: 1,
1826
- },
1827
- {
1828
- where: {
1829
- UserId: userId,
1830
- },
1831
- transaction: dbTransaction,
1832
- },
1833
- );
1823
+ user.MFAEnabled = 1;
1824
+ await user.save({ transaction: dbTransaction });
1834
1825
 
1835
1826
  // 5. Retrieve Session
1836
1827
  const userSession = await this._SessionService.retrieveUserSession(
@@ -1996,9 +1987,14 @@ export class User extends UserBase {
1996
1987
  }
1997
1988
 
1998
1989
  //Make sure email is unique, call LoginUser.CheckUserInfoDuplicated method
1999
- if (data.Email !== this.Email || data.UserName !== this.UserName) {
1990
+ if (data.Email !== this.Email) {
1991
+ await User.checkUserInfoDuplicated(dbTransaction, {
1992
+ UserName: data.UserName,
1993
+ });
1994
+ }
1995
+
1996
+ if (data.UserName !== this.UserName) {
2000
1997
  await User.checkUserInfoDuplicated(dbTransaction, {
2001
- Email: data.Email,
2002
1998
  UserName: data.UserName,
2003
1999
  });
2004
2000
  }