MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / isTokenValid

Method isTokenValid

src/api/providers/qwen-code.ts:166–172  ·  view source on GitHub ↗
(credentials: QwenOAuthCredentials)

Source from the content-addressed store, hash-verified

164 }
165
166 private isTokenValid(credentials: QwenOAuthCredentials): boolean {
167 const TOKEN_REFRESH_BUFFER_MS = 30 * 1000 // 30s buffer
168 if (!credentials.expiry_date) {
169 return false
170 }
171 return Date.now() < credentials.expiry_date - TOKEN_REFRESH_BUFFER_MS
172 }
173
174 private async ensureAuthenticated(): Promise<void> {
175 if (!this.credentials) {

Callers 1

ensureAuthenticatedMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected