fix bug:限制了登录时长等于90天时,登录后会自动退出

This commit is contained in:
baozhoutao 2021-11-03 16:26:56 +08:00
parent 730a5d7325
commit cc5efe388c

View File

@ -892,7 +892,9 @@ export class Mongo implements DatabaseInterface {
isNumber(login_expiration_in_days) &&
login_expiration_in_days > 0
) {
when = moment().subtract(login_expiration_in_days * 24 * 60, "minute").toDate();
when = moment()
.subtract((90 - login_expiration_in_days) * 24 * 60, "minute")
.toDate();
}
//创建Meteor token
@ -915,7 +917,6 @@ export class Mongo implements DatabaseInterface {
_user["services"]["resume"]["loginTokens"].push(hashedToken);
let data = { services: _user["services"] };
await this.collection.updateOne({ _id: userId }, { $set: data });
return true;
}