fixed a bug which was causing username to note get saved on import

This commit is contained in:
Gourav Kumar 2024-07-14 17:41:41 +05:30
parent f6d119c852
commit 846e9a7aa5

View File

@ -59,13 +59,13 @@ export default {
var label = decodeURIComponent(url.pathname.slice(1)); // Remove the leading '/' var label = decodeURIComponent(url.pathname.slice(1)); // Remove the leading '/'
const type = label.slice(1, -1).split("/")[0]; const type = label.slice(1, -1).split("/")[0];
label = label.slice(6); label = label.slice(6);
let accountName, issuerFromLabel; let username, issuerFromLabel;
const labelParts = label.split(":"); const labelParts = label.split(":");
if (labelParts.length === 2) { if (labelParts.length === 2) {
issuerFromLabel = labelParts[0]; issuerFromLabel = labelParts[0];
accountName = labelParts[1]; username = labelParts[1];
} else { } else {
accountName = label; username = label;
} }
const params = {}; const params = {};
@ -86,7 +86,7 @@ export default {
scheme, scheme,
type, type,
label, label,
accountName, username,
issuer, issuer,
secret, secret,
algorithm, algorithm,
@ -121,6 +121,7 @@ export default {
for (var i = 0; i < this.parsedTokens.length; i++) { for (var i = 0; i < this.parsedTokens.length; i++) {
await this.createSecret(this.parsedTokens[i]); await this.createSecret(this.parsedTokens[i]);
} }
this.$emit("close", true);
}, },
}, },
}; };