(state: string)
| 151 | } |
| 152 | |
| 153 | export async function loadOauthRowByState(state: string): Promise<McpOauthRow | null> { |
| 154 | const [row] = await db |
| 155 | .select() |
| 156 | .from(mcpServerOauth) |
| 157 | .where( |
| 158 | and( |
| 159 | eq(mcpServerOauth.state, hashState(state)), |
| 160 | gt(mcpServerOauth.stateCreatedAt, new Date(Date.now() - STATE_TTL_MS)) |
| 161 | ) |
| 162 | ) |
| 163 | .limit(1) |
| 164 | if (!row) return null |
| 165 | return mapOauthRow(row) |
| 166 | } |
| 167 | |
| 168 | export async function saveClientInformation( |
| 169 | rowId: string, |
no test coverage detected