@kksiuda/http-session
Advanced tools
Comparing version 0.9.30 to 0.9.31
@@ -19,2 +19,3 @@ /// <reference types="node" /> | ||
invalidate: (error: string) => Promise<void>; | ||
wasReleased: boolean; | ||
} | ||
@@ -21,0 +22,0 @@ export interface HttpSessionStatusData { |
@@ -123,6 +123,5 @@ "use strict"; | ||
getSessionObject() { | ||
let sessionReleased = false; | ||
const wrap = (fnName, fn, releaseAfter) => { | ||
return (...args) => { | ||
if (sessionReleased) { | ||
if (sessionObject.wasReleased) { | ||
throw new Error(`calling ${fnName} failed because session has already been released`); | ||
@@ -134,7 +133,7 @@ } | ||
if (releaseAfter) | ||
sessionReleased = true; | ||
sessionObject.wasReleased = true; | ||
return fn(...args); | ||
}; | ||
}; | ||
return { | ||
const sessionObject = { | ||
getParams: wrap('getParams', () => this.getParams()), | ||
@@ -146,3 +145,5 @@ request: wrap('request', (options) => this.request(options)), | ||
reportLockout: wrap('reportLockout', () => this.reportLockout(), true), | ||
wasReleased: false, | ||
}; | ||
return sessionObject; | ||
} | ||
@@ -149,0 +150,0 @@ logoutWrapper() { |
{ | ||
"name": "@kksiuda/http-session", | ||
"version": "0.9.30", | ||
"version": "0.9.31", | ||
"description": "Http session and cookies management", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
114519
1435