(
State(state): State<AppState>,
headers: HeaderMap,
Json(payload): Json<PairBrowserPayload>,
)
| 934 | } |
| 935 | |
| 936 | async 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 | |
| 954 | fn is_inspector_agent_transport_path(path: &str) -> bool { |
| 955 | matches!( |
nothing calls this directly
no test coverage detected