MCPcopy Create free account
hub / github.com/Alorse/copilot-to-api / ensureValidToken

Method ensureValidToken

server.js:89–96  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

87 }
88
89 async ensureValidToken() {
90 if (!this.copilotToken || !this.tokenExpiry || Date.now() > this.tokenExpiry) {
91 const success = await this.refreshCopilotToken();
92 if (!success) {
93 throw new Error('Failed to obtain valid Copilot token');
94 }
95 }
96 }
97
98 async getModels() {
99 await this.ensureValidToken();

Callers 2

getModelsMethod · 0.95
chatCompletionMethod · 0.95

Calls 1

refreshCopilotTokenMethod · 0.95

Tested by

no test coverage detected