cauthy-auth 0.24.1 → 0.24.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +20 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -966,6 +966,25 @@ function createCauthy(given = {}) {
|
|
|
966
966
|
orgCache.set(session.accessToken, { at: Date.now(), value });
|
|
967
967
|
return value;
|
|
968
968
|
}
|
|
969
|
+
const forgetting = (fn) => async (...args) => {
|
|
970
|
+
const out2 = await fn(...args);
|
|
971
|
+
orgCache.clear();
|
|
972
|
+
return out2;
|
|
973
|
+
};
|
|
974
|
+
const systemThatRefreshes = {
|
|
975
|
+
...ownSystem,
|
|
976
|
+
organizations: {
|
|
977
|
+
...ownSystem.organizations,
|
|
978
|
+
update: forgetting(ownSystem.organizations.update),
|
|
979
|
+
remove: forgetting(ownSystem.organizations.remove)
|
|
980
|
+
},
|
|
981
|
+
members: {
|
|
982
|
+
...ownSystem.members,
|
|
983
|
+
add: forgetting(ownSystem.members.add),
|
|
984
|
+
setRole: forgetting(ownSystem.members.setRole),
|
|
985
|
+
remove: forgetting(ownSystem.members.remove)
|
|
986
|
+
}
|
|
987
|
+
};
|
|
969
988
|
async function toPublic(session) {
|
|
970
989
|
let orgs = [];
|
|
971
990
|
try {
|
|
@@ -1876,7 +1895,7 @@ function createCauthy(given = {}) {
|
|
|
1876
1895
|
return {
|
|
1877
1896
|
handler,
|
|
1878
1897
|
webhook,
|
|
1879
|
-
system:
|
|
1898
|
+
system: systemThatRefreshes,
|
|
1880
1899
|
getSession,
|
|
1881
1900
|
status,
|
|
1882
1901
|
resolve: resolve2,
|