{"record":{"id":"e065819a91f1c78b","repo":"wasmerio/wasmer","slug":"the-backend-did-not-return-any-nonce-to-auth-the-l","errorCode":null,"errorMessage":"The backend did not return any nonce to auth the login!","messagePattern":"The backend did not return any nonce to auth the login!","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/cli/src/commands/auth/login/mod.rs","lineNumber":99,"sourceCode":"        &self,\n        client: &WasmerClient,\n    ) -> anyhow::Result<AuthorizationState> {\n        let (listener, server_url) = setup_listener().await?;\n\n        let (server_shutdown_tx, mut server_shutdown_rx) = tokio::sync::mpsc::channel::<bool>(1);\n        let (token_tx, mut token_rx) = tokio::sync::mpsc::channel::<AuthorizationState>(1);\n\n        // Create a new AppContext\n        let app_context = BrowserAuthContext {\n            server_shutdown_tx,\n            token_tx,\n        };\n\n        let Nonce { auth_url, .. } =\n            wasmer_backend_api::query::create_nonce(client, \"wasmer-cli\".to_string(), server_url)\n                .await?\n                .ok_or_else(|| {\n                    anyhow::anyhow!(\"The backend did not return any nonce to auth the login!\")\n                })?;\n\n        // if failed to open the browser, then don't error out just print the auth_url with a message\n        println!(\"Opening auth link in your default browser: {}\", &auth_url);\n        println!(\n            \"{}: If browser driven login does not work, manually create a token at https://wasmer.io/settings/access-tokens and log in with `wasmer login <TOKEN>`\",\n            \"NOTE\".yellow().bold()\n        );\n        opener::open_browser(&auth_url).unwrap_or_else(|_| {\n            println!(\n                \"⚠️ Failed to open the browser.\\n\n            Please open the url: {}\",\n                &auth_url\n            );\n        });\n\n        // Jump through hyper 1.0's hoops...\n        let graceful = GracefulShutdown::new();","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/cli/src/commands/auth/login/mod.rs#L81-L117","documentation":"Browser-based login starts by calling `create_nonce` on the Wasmer backend to obtain a `Nonce` containing an `auth_url`. If the backend's response resolves to `None` (no nonce created), the CLI raises this error because it cannot proceed to open an auth URL. It signals the backend refused or failed to start the OAuth-style login flow.","triggerScenarios":"`wasmer login` (browser flow) → `get_token_from_browser` → `create_nonce(client, \"wasmer-cli\", server_url)` returns `None`.","commonSituations":"Backend outage or degraded GraphQL API; pointing the CLI at a registry endpoint that does not support nonce creation (custom/proxy registry); network middleware stripping the response payload.","solutions":["Retry `wasmer login` after checking https://wasmer.io status / your connectivity.","Verify the registry endpoint is the official backend (wasmer.wasmer.wtf/graphql or similar) and supports nonce creation.","Fall back to token login: create a token at https://wasmer.io/settings/access-tokens and run `wasmer login <TOKEN>`.","Check whether a corporate proxy is mangling GraphQL responses."],"exampleFix":"// fallback for users in restricted environments\n// before\n$ wasmer login\n// error: The backend did not return any nonce to auth the login!\n// after: use a manually created token\n$ wasmer login eyJhbGciOi...  # token from https://wasmer.io/settings/access-tokens","handlingStrategy":"fallback","validationCode":"// check backend reachability before attempting browser login\ncurl -fsS https://registry.wasmer.io/graphql -X POST \\\n  -H 'content-type: application/json' \\\n  -d '{\"query\":\"{ __typename }\"}' > /dev/null && echo backend-ok","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer token-based login (`wasmer login <TOKEN>`) in CI or restricted networks.","Check backend status before interactive login sessions.","Ensure the configured registry endpoint supports nonce creation (official backend, not a proxy)."],"tags":["auth","login","backend-api","network"],"backgroundTag":"auth-nnonce-missing","analyzedSha":"8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5","analyzedAt":"2026-09-01T23:06:31.009Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}