Git hosting and a container registry in one Rust binary (axum + Astro)
Importer: also revoke GitHub App user tokens after an import
1 file changed, +3 -2
+3-2backend/src/importer/mod.rs
| @@ -214,8 +214,9 @@ pub async fn start(state: &AppState, viewer: &Viewer, request: shared::StartImpo | ||
| 214 | 214 | let token = request.token.clone(); |
| 215 | 215 | tokio::spawn(async move { |
| 216 | 216 | let result = run(&job_state, import_id, token.clone()).await; |
| 217 | - // Tokens from "Connect GitHub" (gho_) were granted for this import only. | |
| 218 | - if let Some(token) = token.filter(|t| t.starts_with("gho_")) { | |
| 217 | + // Tokens from "Connect GitHub" were granted for this import only: | |
| 218 | + // gho_ from an OAuth app, ghu_ from a GitHub App's user authorization. | |
| 219 | + if let Some(token) = token.filter(|t| t.starts_with("gho_") || t.starts_with("ghu_")) { | |
| 219 | 220 | crate::web::account::revoke_github_token(&job_state, &token).await; |
| 220 | 221 | } |
| 221 | 222 | if let Err(error) = result { |