MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / pair_browser

Function pair_browser

packages/server/src/api/routes.rs:936–952  ·  view source on GitHub ↗
(
    State(state): State<AppState>,
    headers: HeaderMap,
    Json(payload): Json<PairBrowserPayload>,
)

Source from the content-addressed store, hash-verified

934}
935
936async fn pair_browser(
937 State(state): State<AppState>,
938 headers: HeaderMap,
939 Json(payload): Json<PairBrowserPayload>,
940) -> Response {
941 if !auth::pairing_code_matches(&state.config, &payload.code) {
942 return auth::unauthorized_response(&state.config, &headers);
943 }
944 let mut response = Json(json_value!({
945 "ok": true,
946 "accessToken": state.config.access_token,
947 }))
948 .into_response();
949 auth::append_cors_headers(&state.config, &headers, response.headers_mut());
950 auth::append_access_cookie(response.headers_mut(), &state.config.access_token);
951 response
952}
953
954fn is_inspector_agent_transport_path(path: &str) -> bool {
955 matches!(

Callers

nothing calls this directly

Calls 5

pairing_code_matchesFunction · 0.85
unauthorized_responseFunction · 0.85
append_cors_headersFunction · 0.85
append_access_cookieFunction · 0.85
into_responseMethod · 0.80

Tested by

no test coverage detected