MCPcopy Index your code
hub / github.com/21st-dev/1code / getToken

Method getToken

src/main/auth-store.ts:161–169  ·  view source on GitHub ↗

* Get current token if valid

()

Source from the content-addressed store, hash-verified

159 * Get current token if valid
160 */
161 getToken(): string | null {
162 const data = this.load()
163 if (!data) return null
164
165 const expiresAt = new Date(data.expiresAt).getTime()
166 if (expiresAt <= Date.now()) return null
167
168 return data.token
169 }
170
171 /**
172 * Get refresh token

Callers 1

getValidTokenMethod · 0.45

Calls 1

loadMethod · 0.95

Tested by

no test coverage detected