autologin with iris.myKey pin 1234
This commit is contained in:
parent
a06dc977bc
commit
d1085410ec
@ -86,6 +86,7 @@ export class MultiAccountStore extends ExternalStore<LoginSession> {
|
|||||||
};
|
};
|
||||||
v.extraChats ??= [];
|
v.extraChats ??= [];
|
||||||
}
|
}
|
||||||
|
this.#loadIrisKeyIfExists();
|
||||||
}
|
}
|
||||||
|
|
||||||
getSessions() {
|
getSessions() {
|
||||||
@ -217,6 +218,23 @@ export class MultiAccountStore extends ExternalStore<LoginSession> {
|
|||||||
return { ...s };
|
return { ...s };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async #loadIrisKeyIfExists() {
|
||||||
|
try {
|
||||||
|
const irisKeyJSON = window.localStorage.getItem('iris.myKey');
|
||||||
|
if (irisKeyJSON) {
|
||||||
|
const irisKeyObj = JSON.parse(irisKeyJSON);
|
||||||
|
if (irisKeyObj.priv) {
|
||||||
|
const privateKey = await PinEncrypted.create(irisKeyObj.priv, '1234');
|
||||||
|
this.loginWithPrivateKey(privateKey);
|
||||||
|
window.localStorage.removeItem('iris.myKey');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error("Failed to load iris key", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#migrate() {
|
#migrate() {
|
||||||
let didMigrate = false;
|
let didMigrate = false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user