@inrupt/solid-client-authn-node
Advanced tools
Comparing version 2.2.1 to 2.2.2
{ | ||
"name": "@inrupt/solid-client-authn-node", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"license": "MIT", | ||
@@ -26,7 +26,7 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@types/node": "^20.14.0", | ||
"@types/node": "^20.14.2", | ||
"@types/uuid": "^9.0.8" | ||
}, | ||
"dependencies": { | ||
"@inrupt/solid-client-authn-core": "^2.2.1", | ||
"@inrupt/solid-client-authn-core": "^2.2.2", | ||
"jose": "^5.1.3", | ||
@@ -42,3 +42,3 @@ "openid-client": "^5.6.5", | ||
}, | ||
"gitHead": "f8a7a135da9896beea3c16aa1e6a99fccfdf1e08" | ||
"gitHead": "47822c4953af9805784a721a36ef1264aa1f204f" | ||
} |
@@ -305,7 +305,9 @@ // | ||
// isLoggedIn is stored as a string under the hood, but deserialized as a boolean | ||
expect(session).toEqual({ | ||
...sessionInfo, | ||
isLoggedIn: true, | ||
keepAlive: true, | ||
}); | ||
expect(session).toEqual( | ||
expect.objectContaining({ | ||
...sessionInfo, | ||
isLoggedIn: true, | ||
keepAlive: true, | ||
}), | ||
); | ||
}); | ||
@@ -312,0 +314,0 @@ }); |
@@ -73,2 +73,3 @@ // | ||
oidcIssuer: sessionInfo.issuer, | ||
tokenType: sessionInfo.tokenType, | ||
}); | ||
@@ -75,0 +76,0 @@ } |
@@ -50,18 +50,44 @@ // | ||
): Promise<(ISessionInfo & ISessionInternalInfo) | undefined> { | ||
const [webId, isLoggedIn, refreshToken, issuer, keepAlive] = | ||
await Promise.all([ | ||
this.storageUtility.getForUser(sessionId, "webId"), | ||
this.storageUtility.getForUser(sessionId, "isLoggedIn"), | ||
this.storageUtility.getForUser(sessionId, "refreshToken"), | ||
this.storageUtility.getForUser(sessionId, "issuer"), | ||
this.storageUtility.getForUser(sessionId, "keepAlive"), | ||
]); | ||
const [ | ||
webId, | ||
isLoggedIn, | ||
clientAppId, | ||
expirationDate, | ||
refreshToken, | ||
issuer, | ||
redirectUrl, | ||
clientAppSecret, | ||
dpop, | ||
keepAlive, | ||
] = await Promise.all([ | ||
// ISessionInfo | ||
this.storageUtility.getForUser(sessionId, "webId"), | ||
this.storageUtility.getForUser(sessionId, "isLoggedIn"), | ||
this.storageUtility.getForUser(sessionId, "clientAppId"), | ||
this.storageUtility.getForUser(sessionId, "expirationDate"), | ||
// ISessionInternalInfo | ||
this.storageUtility.getForUser(sessionId, "refreshToken"), | ||
this.storageUtility.getForUser(sessionId, "issuer"), | ||
this.storageUtility.getForUser(sessionId, "redirectUrl"), | ||
this.storageUtility.getForUser(sessionId, "clientAppSecret"), | ||
this.storageUtility.getForUser(sessionId, "dpop"), | ||
this.storageUtility.getForUser(sessionId, "keepAlive"), | ||
]); | ||
if (issuer !== undefined) { | ||
return { | ||
// ISessionInfo | ||
sessionId, | ||
webId, | ||
isLoggedIn: isLoggedIn === "true", | ||
clientAppId, | ||
expirationDate: expirationDate | ||
? Number.parseInt(expirationDate, 10) | ||
: undefined, | ||
// ISessionInternalInfo | ||
refreshToken, | ||
issuer, | ||
clientAppSecret, | ||
redirectUrl, | ||
tokenType: dpop === "true" ? "DPoP" : "Bearer", | ||
keepAlive: keepAlive === "true", | ||
@@ -68,0 +94,0 @@ }; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
563429
11608