MCPcopy
hub / github.com/tiagozip/cap / _getChallenge

Method _getChallenge

server/index.js:241–247  ·  view source on GitHub ↗

* Retrieves challenge data from storage * @private * @param {string} token - Challenge token * @returns {Promise } Challenge data or null if not found

(token)

Source from the content-addressed store, hash-verified

239 * @returns {Promise<ChallengeData|null>} Challenge data or null if not found
240 */
241 async _getChallenge(token) {
242 if (this.config.storage?.challenges?.read) {
243 return (await this.config.storage.challenges.read(token)) || null;
244 }
245
246 return this.config.state.challengesList[token] || null;
247 }
248
249 /**
250 * Deletes challenge from storage

Callers 1

redeemChallengeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected