Compare commits

..

No commits in common. "v0.2.0-develop.9" and "v0.2.0-develop.8" have entirely different histories.

4 changed files with 8 additions and 13 deletions

View File

@ -1,10 +1,3 @@
# [0.2.0-develop.9](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.8...v0.2.0-develop.9) (2023-06-23)
### Bug Fixes
* refactor initPortal to return the instance ([89d2439](https://git.lumeweb.com/LumeWeb/libweb/commit/89d24393e5ec8c3d0846b00bec2912dd177e34a8))
# [0.2.0-develop.8](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.7...v0.2.0-develop.8) (2023-06-23) # [0.2.0-develop.8](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.7...v0.2.0-develop.8) (2023-06-23)

4
npm-shrinkwrap.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@lumeweb/libweb", "name": "@lumeweb/libweb",
"version": "0.2.0-develop.9", "version": "0.2.0-develop.8",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@lumeweb/libweb", "name": "@lumeweb/libweb",
"version": "0.2.0-develop.9", "version": "0.2.0-develop.8",
"dependencies": { "dependencies": {
"@lumeweb/libportal": "0.2.0-develop.5", "@lumeweb/libportal": "0.2.0-develop.5",
"@noble/curves": "^1.1.0", "@noble/curves": "^1.1.0",

View File

@ -1,6 +1,6 @@
{ {
"name": "@lumeweb/libweb", "name": "@lumeweb/libweb",
"version": "0.2.0-develop.9", "version": "0.2.0-develop.8",
"main": "lib/index.js", "main": "lib/index.js",
"type": "module", "type": "module",
"repository": { "repository": {

View File

@ -20,7 +20,7 @@ export function maybeInitDefaultPortals(): ErrTuple {
} }
for (const portal of DEFAULT_PORTAL_LIST) { for (const portal of DEFAULT_PORTAL_LIST) {
addActivePortal(initPortal(portal)); initPortal(portal);
} }
return [null, null]; return [null, null];
@ -58,7 +58,7 @@ export function addActivePortal(portal: Client) {
ACTIVE_PORTALS.add(portal); ACTIVE_PORTALS.add(portal);
} }
export function initPortal(portal: Portal): Client { export function initPortal(portal: Portal) {
const sessions = getPortalSessions(); const sessions = getPortalSessions();
let jwt: string | null = null; let jwt: string | null = null;
if (sessions) { if (sessions) {
@ -67,12 +67,14 @@ export function initPortal(portal: Portal): Client {
} }
} }
return new Client({ const client = new Client({
email: generatePortalEmail(portal), email: generatePortalEmail(portal),
portalUrl: portal.url, portalUrl: portal.url,
privateKey: generatePortalKeyPair(portal).privateKey, privateKey: generatePortalKeyPair(portal).privateKey,
jwt: jwt as string, jwt: jwt as string,
}); });
addActivePortal(client);
} }
export function getPortalSessions() { export function getPortalSessions() {