@social-mail/social-mail-web-server 1.4.808 → 1.4.809

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": "@social-mail/social-mail-web-server",
3
- "version": "1.4.808",
3
+ "version": "1.4.809",
4
4
  "description": "## Phase 1",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -51,7 +51,6 @@ export default class UserAuthFactor {
51
51
  isdCode: string;
52
52
 
53
53
  @Column({ dataType: "Boolean"})
54
- @ReadOnlyJsonProperty
55
54
  verified: boolean;
56
55
 
57
56
  @Column({})
@@ -85,7 +85,12 @@ export default class UserAuthFactorEvents extends AuthenticatedEvents<UserAuthFa
85
85
 
86
86
  async beforeUpdate(entity: UserAuthFactor, entry: ChangeEntry<UserAuthFactor>) {
87
87
  if(entry.isModified("verified")) {
88
- throw new EntityAccessError(`Cannot modify verified`);
88
+ if (!this.sessionUser.isAdmin) {
89
+ throw new EntityAccessError(`Cannot modify verified`);
90
+ }
91
+ if(entity.verified) {
92
+ return;
93
+ }
89
94
  }
90
95
  if (entity.method !== "totp") {
91
96
  throw new EntityAccessError(`Cannot modify Auth Factor.`);