MCPcopy Create free account
hub / github.com/error311/FileRise / fetchUserPermissionsOnce

Function fetchUserPermissionsOnce

public/js/auth.js:48–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46}
47
48async function fetchUserPermissionsOnce() {
49 if (window.__FR_PERMISSIONS_CACHE) return window.__FR_PERMISSIONS_CACHE;
50 if (window.__FR_PERMISSIONS_PROMISE) return window.__FR_PERMISSIONS_PROMISE;
51 window.__FR_PERMISSIONS_PROMISE = (async () => {
52 try {
53 const r = await fetch(PERMISSIONS_URL, { credentials: 'include' });
54 const data = await r.json();
55 window.__FR_PERMISSIONS_CACHE = data || {};
56 return window.__FR_PERMISSIONS_CACHE;
57 } catch (e) {
58 window.__FR_PERMISSIONS_CACHE = {};
59 return {};
60 } finally {
61 window.__FR_PERMISSIONS_PROMISE = null;
62 }
63 })();
64 return window.__FR_PERMISSIONS_PROMISE;
65}
66
67
68

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected