gitbutlerapp/gitbutler · warning
Authorization process aborted by user.
Error message
Authorization process aborted by user.
What it means
During GitHub OAuth device-flow authentication, the CLI prints a code, opens the browser, and then blocks on a y/n confirmation asking the user to press 'y' after completing authorization in the browser. If the user enters anything other than 'y' (e.g. 'n', Enter for empty, or EOF on a piped stdin), the flow is treated as intentionally aborted and github_auth bails with this message before polling auth status.
Solutions
- Re-run the auth command and answer 'y' after completing authorization in the browser
- Ensure the command runs in an interactive terminal so the confirmation prompt can be answered
- Complete the browser authorization step before confirming; if the browser step failed, restart the whole device-flow login
Example fix
// before (non-interactive) echo "" | but auth github // after but auth github # run interactively, answer 'y' after browser auth
Defensive patterns
Strategy: try-catch
Validate before calling
const isInteractive = process.stdin.isTTY;
if (!isInteractive) throw new Error('GitHub OAuth login requires an interactive terminal'); Type guard
const isAbortError = (e) => e instanceof Error && /aborted by user/i.test(e.message);
Try / catch
try {
await runGithubAuth();
} catch (e) {
if (isAbortError(e)) {
console.log('Login cancelled; re-run to try again.');
} else throw e;
} Prevention
- Run auth commands in a TTY, never with piped/redirected stdin
- Complete the browser step before answering the confirmation
- Know that anything except 'y' at the prompt cancels the flow
When it happens
Trigger: During `but auth github` (github_oauth): pressing Enter/n at the "press 'y' to continue" prompt, closing stdin (Ctrl+D), or running the command non-interactively so confirm_no_default receives no 'y'.
Common situations: Running the CLI inside a script or CI where stdin is not a TTY; user abandoning login halfway; confusion about needing to press 'y' after browser auth rather than just Enter.
Related errors
- Could not determine authentication method
- Could not determine which forge provider to authenticate…
- Known account is not correctly authenticated. Run
- No authenticated forge users found. Run
- No authenticated GitHub users found.\nRun 'but config forge…
AI-assisted analysis of gitbutlerapp/gitbutler@58e5313667 (2026-09-18).
Data as JSON: /api/errors/bab5c5f9d7aa46a5.
Report an issue: GitHub.
Appendix: source
Thrown at crates/but/src/command/config.rs:1086
writeln!(inout, "Authentication successful! Welcome, {login}.")?;
Ok(())
}
/// Authenticate with GitHub using the device OAuth flow
async fn github_oauth(mut inout: InputOutputChannel<'_>) -> Result<()> {
let code = but_api::github::init_github_device_oauth().await?;
writeln!(
inout,
"Device authorization initiated. Please visit the following URL and enter the code:\n\nhttps://github.com/login/device\n\nCode: {}\n\n",
code.user_code
)?;
if inout.confirm_no_default(
"After completing authorization in your browser, press 'y' to continue.",
)? != ConfirmOrEmpty::Yes
{
anyhow::bail!("Authorization process aborted by user.")
}
let status = but_api::github::check_github_auth_status(code.device_code)
.await
.map_err(|err| err.context("Authentication failed"))?;
writeln!(
inout,
"Authentication successful! Welcome, {}.",
status.login
)?;
Ok(())
}
async fn display_authenticated_github_accounts(
known_gh_accounts: &Vec<but_github::GithubAccountIdentifier>,
out: &mut dyn Write,View on GitHub (pinned to 58e5313667)