Compare commits

...

3 Commits

Author SHA1 Message Date
semantic-release-bot 40493fbcc0 chore(release): 0.2.0-develop.9 [skip ci]
# [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](89d24393e5))
2023-06-23 23:32:12 +00:00
Derrick Hammer ac38feae92
Merge remote-tracking branch 'origin/develop' into develop 2023-06-23 19:31:24 -04:00
Derrick Hammer 89d24393e5
fix: refactor initPortal to return the instance 2023-06-23 19:30:48 -04:00
4 changed files with 13 additions and 8 deletions

View File

@ -1,3 +1,10 @@
# [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)

4
npm-shrinkwrap.json generated
View File

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

View File

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

View File

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