don't clear application lock when user token expired

This commit is contained in:
MaysWind
2020-11-25 00:21:44 +08:00
parent f9f1774215
commit 2c72ce5f5c
7 changed files with 85 additions and 47 deletions
+18 -8
View File
@@ -185,10 +185,15 @@ export default {
return;
}
if (self.$settings.isEnableApplicationLock()) {
self.$settings.setEnableApplicationLock(false);
self.$settings.setEnableApplicationLockWebAuthn(false);
self.$user.clearWebAuthnConfig();
if (self.$settings.isEnableApplicationLock() || self.$user.getUserAppLockState()) {
const appLockState = self.$user.getUserAppLockState();
if (!appLockState || appLockState.username !== data.result.user.username) {
self.$user.clearTokenAndUserInfo(true);
self.$settings.setEnableApplicationLock(false);
self.$settings.setEnableApplicationLockWebAuthn(false);
self.$user.clearWebAuthnConfig();
}
}
self.$user.updateTokenAndUserInfo(data.result);
@@ -264,10 +269,15 @@ export default {
return;
}
if (self.$settings.isEnableApplicationLock()) {
self.$settings.setEnableApplicationLock(false);
self.$settings.setEnableApplicationLockWebAuthn(false);
self.$user.clearWebAuthnConfig();
if (self.$settings.isEnableApplicationLock() || self.$user.getUserAppLockState()) {
const appLockState = self.$user.getUserAppLockState();
if (!appLockState || appLockState.username !== data.result.user.username) {
self.$user.clearTokenAndUserInfo(true);
self.$settings.setEnableApplicationLock(false);
self.$settings.setEnableApplicationLockWebAuthn(false);
self.$user.clearWebAuthnConfig();
}
}
self.$user.updateTokenAndUserInfo(data.result);