zed-industries/zed · error

authentication canceled

Error message

authentication canceled

What it means

During the interactive sign-in flow, the authentication attempt (credentials provider / web login) was aborted by the user — e.g. the sign-in prompt was dismissed or cancelled — so the client surfaces this sentinel error rather than treating the cancellation as an authentication failure or network problem.

Solutions

  1. Re-run sign-in and complete the browser/authentication prompt this time
  2. If cancellation was accidental, retry and let the flow finish before dismissing it
  3. Treat this error as a clean abort in callers: don't mark credentials invalid, just return to the signed-out state
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at crates/client/src/client.rs:939 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/f25cffbd98b6b363. Report an issue: GitHub.

Appendix: source

Thrown at crates/client/src/client.rs:939

                    match authenticate {
                        Ok(creds) => {
                            if IMPERSONATE_LOGIN.is_none() {
                                self.credentials_provider
                                    .write_credentials(creds.user_id, creds.access_token.clone(), cx)
                                    .await
                                    .log_err();
                            }

                            credentials = Some(creds);
                        },
                        Err(err) => {
                            self.set_status(Status::AuthenticationError, cx);
                            return Err(err);
                        }
                    }
                }
                _ = status_rx.next().fuse() => {
                    return Err(anyhow!("authentication canceled"));
                }
            }
        }

        let credentials = credentials.unwrap();
        self.set_id(credentials.user_id);
        self.cloud_client
            .set_credentials(credentials.user_id as u32, credentials.access_token.clone());
        self.state.write().credentials = Some(credentials.clone());
        self.set_status(
            if is_reauthenticating {
                Status::Reauthenticated
            } else {
                Status::Authenticated
            },
            cx,
        );

View on GitHub (pinned to f4178619ac)