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

Method saveRefreshToken

src/oauth-store.ts:122–140  ·  view source on GitHub ↗
(tokenHash: string, record: PersistedRefreshTokenRecord)

Source from the content-addressed store, hash-verified

120 }
121
122 saveRefreshToken(tokenHash: string, record: PersistedRefreshTokenRecord): void {
123 this.database.sqlite
124 .prepare(
125 `insert into oauth_refresh_tokens (token_hash, client_id, scopes_json, expires_at, resource)
126 values (?, ?, ?, ?, ?)
127 on conflict(token_hash) do update set
128 client_id = excluded.client_id,
129 scopes_json = excluded.scopes_json,
130 expires_at = excluded.expires_at,
131 resource = excluded.resource`,
132 )
133 .run(
134 tokenHash,
135 record.clientId,
136 JSON.stringify(record.scopes),
137 record.expiresAt,
138 record.resource ?? null,
139 );
140 }
141
142 saveTokenPair(pair: PersistedTokenPair, consumedRefreshTokenHash?: string): boolean {
143 const save = this.database.sqlite.transaction(() => {

Callers 2

saveTokenPairMethod · 0.95

Calls

no outgoing calls

Tested by 1