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

Method saveAccessToken

src/oauth-store.ts:81–99  ·  view source on GitHub ↗
(tokenHash: string, record: PersistedAccessTokenRecord)

Source from the content-addressed store, hash-verified

79 }
80
81 saveAccessToken(tokenHash: string, record: PersistedAccessTokenRecord): void {
82 this.database.sqlite
83 .prepare(
84 `insert into oauth_access_tokens (token_hash, client_id, scopes_json, expires_at, resource)
85 values (?, ?, ?, ?, ?)
86 on conflict(token_hash) do update set
87 client_id = excluded.client_id,
88 scopes_json = excluded.scopes_json,
89 expires_at = excluded.expires_at,
90 resource = excluded.resource`,
91 )
92 .run(
93 tokenHash,
94 record.clientId,
95 JSON.stringify(record.scopes),
96 record.expiresAt,
97 record.resource ?? null,
98 );
99 }
100
101 getAccessToken(tokenHash: string): PersistedAccessTokenRecord | undefined {
102 const row = this.database.sqlite

Callers 1

saveTokenPairMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected