| 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); |