Compare commits

...

3 Commits

Author SHA1 Message Date
semantic-release-bot 243422a36a chore(release): 0.2.0-develop.31 [skip ci]
# [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](a1b67e71cd))
2023-08-15 08:31:20 +00:00
Derrick Hammer 62b7b0629e
Merge remote-tracking branch 'origin/develop' into develop 2023-08-15 04:30:14 -04:00
Derrick Hammer a1b67e71cd
feat: add loginActivePortals function 2023-08-15 04:30:09 -04:00
4 changed files with 29 additions and 3 deletions

View File

@ -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)

4
npm-shrinkwrap.json generated
View File

@ -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",

View File

@ -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": {

View File

@ -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();
}
}
}