code refactor

This commit is contained in:
MaysWind
2023-08-26 23:35:53 +08:00
parent 9ee59215c8
commit c66bc62c41
2 changed files with 8 additions and 8 deletions
+3 -3
View File
@@ -171,13 +171,13 @@ export default {
return;
}
this.verifyingByWebAuthn = true;
self.verifyingByWebAuthn = true;
webauthn.verifyCredential(
self.userStore.currentUserInfo,
self.$user.getWebAuthnCredentialId()
).then(({ id, userName, userSecret }) => {
this.verifyingByWebAuthn = false;
self.verifyingByWebAuthn = false;
self.$user.unlockTokenByWebAuthn(id, userName, userSecret);
self.tokensStore.refreshTokenAndRevokeOldToken().then(response => {
@@ -193,7 +193,7 @@ export default {
self.$router.replace('/');
}).catch(error => {
this.verifyingByWebAuthn = false;
self.verifyingByWebAuthn = false;
logger.error('failed to use webauthn to verify', error);
if (error.notSupported) {