MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / getCachedToken

Method getCachedToken

wxapp/nestle.js:132–138  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

130 }
131
132 getCachedToken() {
133 const cache = readTokenCache();
134 const item = cache[this.cacheKey()];
135 if (!item?.authorization || !item?.expiresAt) return "";
136 if (Date.now() > Number(item.expiresAt) - 5 * 60 * 1000) return "";
137 return item.authorization;
138 }
139
140 saveCachedToken() {
141 if (!this.authorization) return;

Callers 1

loginMethod · 0.95

Calls 2

cacheKeyMethod · 0.95
readTokenCacheFunction · 0.70

Tested by

no test coverage detected