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

Method getAccessToken

src/oauth-store.ts:101–116  ·  view source on GitHub ↗
(tokenHash: string)

Source from the content-addressed store, hash-verified

99 }
100
101 getAccessToken(tokenHash: string): PersistedAccessTokenRecord | undefined {
102 const row = this.database.sqlite
103 .prepare(
104 "select client_id, scopes_json, expires_at, resource from oauth_access_tokens where token_hash = ?",
105 )
106 .get(tokenHash) as
107 | {
108 client_id: string;
109 scopes_json: string;
110 expires_at: number;
111 resource: string | null;
112 }
113 | undefined;
114
115 return row ? rowToAccessTokenRecord(row) : undefined;
116 }
117
118 deleteAccessToken(tokenHash: string): void {
119 this.database.sqlite.prepare("delete from oauth_access_tokens where token_hash = ?").run(tokenHash);

Callers 4

testExpiredTokenCleanupFunction · 0.95
verifyAccessTokenMethod · 0.80

Calls 1

rowToAccessTokenRecordFunction · 0.85

Tested by 3

testExpiredTokenCleanupFunction · 0.76