Skip to content

Commit

Permalink
Don't show the login panel if we are staying logged in
Browse files Browse the repository at this point in the history
This confused bitwarden
  • Loading branch information
ianopolous committed Jan 21, 2025
1 parent afb90fe commit 2705c8e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/components/Login.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="app-login">
<div class="app-login" v-if="!autoLoggingIn">
<input
type="text"
autofocus
Expand Down Expand Up @@ -57,6 +57,7 @@ module.exports = {
demo: true,
stayLoggedIn: false,
isLoggingIn: false,
autoLoggingIn: true,
showMultiFactorAuth: false,
};
},
Expand All @@ -73,9 +74,9 @@ module.exports = {
mixins:[routerMixins, UriDecoder, i18n],
mounted() {
this.$refs.username.focus()
// :)
setTimeout(() => this.autoLogin(), 0);
setTimeout(() => this.autoLogin(), 0);
if (this.$refs.username != null)
this.$refs.username.focus()
},
methods: {
...Vuex.mapActions([
Expand Down Expand Up @@ -105,7 +106,8 @@ module.exports = {
let loginRoot = peergos.shared.crypto.symmetric.SymmetricKey.fromByteArray(rootKeyPair.rootKey);
directGetEntryDataFromCacheProm(rootKeyPair.username).thenApply(function (entryPoints) {
if (entryPoints == null) {
that.$toast.error("Legacy accounts can't stay logged in. Please change your password to upgrade your account", {timeout:false, id: 'login'})
that.$toast.error("Legacy accounts can't stay logged in. Please change your password to upgrade your account", {timeout:false, id: 'login'});
that.autoLoggingIn = false;
} else {
that.isLoggingIn = true;
let entryData = peergos.shared.user.UserStaticData.fromByteArray(entryPoints);
Expand All @@ -116,10 +118,13 @@ module.exports = {
})
.exceptionally(function (throwable) {
that.isLoggingIn = false;
that.autoLoggingIn = false;
that.$toast.error(that.uriDecode(throwable.getMessage()), {timeout:false, id: 'login'})
});
}
});
} else {
that.autoLoggingIn = false;
}
});
}
Expand Down

0 comments on commit 2705c8e

Please sign in to comment.