@social-mail/social-mail-web-server 1.4.807 → 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/dist/server/model/entities/UserAuthFactor.d.ts.map +1 -1
- package/dist/server/model/entities/UserAuthFactor.js +1 -2
- package/dist/server/model/entities/UserAuthFactor.js.map +1 -1
- package/dist/server/model/events/LoginSessionEvents.js +1 -1
- package/dist/server/model/events/LoginSessionEvents.js.map +1 -1
- package/dist/server/model/events/UserAuthFactorEvents.d.ts.map +1 -1
- package/dist/server/model/events/UserAuthFactorEvents.js +6 -1
- package/dist/server/model/events/UserAuthFactorEvents.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/server/model/entities/UserAuthFactor.ts +0 -1
- package/src/server/model/events/LoginSessionEvents.ts +1 -1
- package/src/server/model/events/UserAuthFactorEvents.ts +6 -1
package/package.json
CHANGED
|
@@ -139,7 +139,7 @@ export default class LoginSessionEvents extends EntityEvents<LoginSession> {
|
|
|
139
139
|
const otpIn = await this.db.userAuthFactors.where(user, (p) => (x) => x.userID === p.userID && x.method === "otp-in")
|
|
140
140
|
.toArray();
|
|
141
141
|
|
|
142
|
-
if (otpIn) {
|
|
142
|
+
if (otpIn.length) {
|
|
143
143
|
const code = entity.smsToken = AppStringHelper.last(DateTime.now.msSinceEpoch.toString(), 6);
|
|
144
144
|
const idsCodes = otpIn.map((x) => x.isdCode.startsWith("+") ? x.isdCode : "+" + x.isdCode );
|
|
145
145
|
entity.smsConfig = await ServiceProvider.resolve(this, IncomingSmsService).prepareCode(code, ... idsCodes);
|
|
@@ -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
|
-
|
|
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.`);
|