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.mjs
CHANGED
|
@@ -918,6 +918,25 @@ function createCauthy(given = {}) {
|
|
|
918
918
|
orgCache.set(session.accessToken, { at: Date.now(), value });
|
|
919
919
|
return value;
|
|
920
920
|
}
|
|
921
|
+
const forgetting = (fn) => async (...args) => {
|
|
922
|
+
const out2 = await fn(...args);
|
|
923
|
+
orgCache.clear();
|
|
924
|
+
return out2;
|
|
925
|
+
};
|
|
926
|
+
const systemThatRefreshes = {
|
|
927
|
+
...ownSystem,
|
|
928
|
+
organizations: {
|
|
929
|
+
...ownSystem.organizations,
|
|
930
|
+
update: forgetting(ownSystem.organizations.update),
|
|
931
|
+
remove: forgetting(ownSystem.organizations.remove)
|
|
932
|
+
},
|
|
933
|
+
members: {
|
|
934
|
+
...ownSystem.members,
|
|
935
|
+
add: forgetting(ownSystem.members.add),
|
|
936
|
+
setRole: forgetting(ownSystem.members.setRole),
|
|
937
|
+
remove: forgetting(ownSystem.members.remove)
|
|
938
|
+
}
|
|
939
|
+
};
|
|
921
940
|
async function toPublic(session) {
|
|
922
941
|
let orgs = [];
|
|
923
942
|
try {
|
|
@@ -1828,7 +1847,7 @@ function createCauthy(given = {}) {
|
|
|
1828
1847
|
return {
|
|
1829
1848
|
handler,
|
|
1830
1849
|
webhook,
|
|
1831
|
-
system:
|
|
1850
|
+
system: systemThatRefreshes,
|
|
1832
1851
|
getSession,
|
|
1833
1852
|
status,
|
|
1834
1853
|
resolve: resolve2,
|