MCPcopy Index your code
hub / github.com/simstudioai/sim / loadOauthRowByState

Function loadOauthRowByState

apps/sim/lib/mcp/oauth/storage.ts:153–166  ·  view source on GitHub ↗
(state: string)

Source from the content-addressed store, hash-verified

151}
152
153export 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
168export async function saveClientInformation(
169 rowId: string,

Callers 1

route.tsFile · 0.90

Calls 3

hashStateFunction · 0.85
mapOauthRowFunction · 0.85
eqFunction · 0.50

Tested by

no test coverage detected