MCPcopy Create free account
hub / github.com/Waishnav/devspace / verifyAccessToken

Method verifyAccessToken

src/oauth-provider.ts:238–251  ·  view source on GitHub ↗
(token: string)

Source from the content-addressed store, hash-verified

236 }
237
238 async verifyAccessToken(token: string): Promise<AuthInfo> {
239 const record = this.oauthStore.getAccessToken(hashToken(token));
240 if (!record || record.expiresAt < Math.floor(Date.now() / 1000)) {
241 throw new InvalidTokenError("Invalid or expired access token");
242 }
243
244 return {
245 token,
246 clientId: record.clientId,
247 scopes: record.scopes,
248 expiresAt: record.expiresAt,
249 resource: record.resource ? new URL(record.resource) : undefined,
250 };
251 }
252
253 async revokeToken(_client: OAuthClientInformationFull, request: OAuthTokenRevocationRequest): Promise<void> {
254 const hashed = hashToken(request.token);

Calls 2

getAccessTokenMethod · 0.80
hashTokenFunction · 0.70

Tested by 1