Compare commits
3 Commits
v0.2.0-dev
...
v0.2.0-dev
Author | SHA1 | Date |
---|---|---|
semantic-release-bot | 243422a36a | |
Derrick Hammer | 62b7b0629e | |
Derrick Hammer | a1b67e71cd |
|
@ -1,3 +1,10 @@
|
|||
# [0.2.0-develop.31](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.30...v0.2.0-develop.31) (2023-08-15)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add loginActivePortals function ([a1b67e7](https://git.lumeweb.com/LumeWeb/libweb/commit/a1b67e71cd51003cae5f51ce927f6f9b6fa46ec6))
|
||||
|
||||
# [0.2.0-develop.30](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.29...v0.2.0-develop.30) (2023-08-10)
|
||||
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@lumeweb/libweb",
|
||||
"version": "0.2.0-develop.30",
|
||||
"version": "0.2.0-develop.31",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@lumeweb/libweb",
|
||||
"version": "0.2.0-develop.30",
|
||||
"version": "0.2.0-develop.31",
|
||||
"dependencies": {
|
||||
"@lumeweb/community-portals": "^0.1.0-develop.6",
|
||||
"@lumeweb/libportal": "0.2.0-develop.17",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@lumeweb/libweb",
|
||||
"version": "0.2.0-develop.30",
|
||||
"version": "0.2.0-develop.31",
|
||||
"main": "lib/index.js",
|
||||
"type": "module",
|
||||
"repository": {
|
||||
|
|
|
@ -4,6 +4,7 @@ import { deriveChildKey } from "#keys.js";
|
|||
import { ed25519 } from "@noble/curves/ed25519";
|
||||
import { bytesToHex } from "@noble/hashes/utils";
|
||||
import COMMUNITY_PORTAL_LIST from "@lumeweb/community-portals";
|
||||
import { NO_PORTALS_ERROR } from "#err.js";
|
||||
|
||||
let activePortalMasterKey;
|
||||
|
||||
|
@ -138,3 +139,21 @@ export function loadSavedPortals(): Portal[] | null {
|
|||
|
||||
return JSON.parse(portals);
|
||||
}
|
||||
|
||||
export async function loginActivePortals() {
|
||||
const activePortals = getActivePortals();
|
||||
|
||||
if (!activePortals.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const portal of activePortals) {
|
||||
if (!(await portal.isLoggedIn())) {
|
||||
try {
|
||||
await portal.register();
|
||||
} catch {}
|
||||
|
||||
await portal.login();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue