Compare commits
3 Commits
v0.2.0-dev
...
v0.2.0-dev
Author | SHA1 | Date |
---|---|---|
semantic-release-bot | 40493fbcc0 | |
Derrick Hammer | ac38feae92 | |
Derrick Hammer | 89d24393e5 |
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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": {
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue