decolua/9router · error · Error
No authorization code received
Error message
No authorization code received
What it means
Thrown by AntigravityService.connect when the OAuth callback arrived without an `error` parameter but also without a required `code` parameter. The local callback server captured the redirect, but Google's response carried no authorization code, so the token exchange cannot proceed. Unlike error 244, this is an unexpected/malformed callback rather than an explicit denial.
Source
Thrown at src/lib/oauth/services/antigravity.js:278
}, 300000);
const checkInterval = setInterval(() => {
if (callbackParams) {
clearInterval(checkInterval);
clearTimeout(timeout);
resolve();
}
}, 100);
});
close();
if (callbackParams.error) {
throw new Error(callbackParams.error_description || callbackParams.error);
}
if (!callbackParams.code) {
throw new Error("No authorization code received");
}
spinner.start("Exchanging code for tokens...");
// Exchange code for tokens
const tokens = await this.exchangeCode(callbackParams.code, redirectUri);
spinner.text = "Fetching user info...";
// Get user info
const userInfo = await this.getUserInfo(tokens.access_token);
spinner.text = "Loading Code Assist configuration...";
// Load Code Assist to get project ID and tier
const { projectId, tierId } = await this.loadCodeAssist(tokens.access_token);
if (!projectId) {View on GitHub (pinned to 90b52e06ff)
Solutions
- Re-run the connect command and complete the Google login in the browser window it opens — don't navigate to the callback URL manually
- Disable browser extensions/ad-blockers that may strip query parameters and retry
- Check that no corporate proxy sits between the browser and the localhost callback server
- If it reproduces, log callbackParams in connect() to see what the callback server actually received
Defensive patterns
Strategy: validation
Validate before calling
if (!callbackParams.code && !callbackParams.error) {
throw new Error(`Callback missing both code and error. Received keys: ${Object.keys(callbackParams).join(',')}`);
} Type guard
function hasAuthCode(params) { return params != null && typeof params.code === 'string' && params.code.length > 0; } Try / catch
try {
await service.connect();
} catch (e) {
if (e.message === 'No authorization code received') {
console.error('Callback had no code param. Re-run connect and complete login in the opened browser window.');
} else throw e;
} Prevention
- Complete login only in the browser window the CLI opened — don't paste the callback URL manually
- Disable extensions/ad-blockers that strip query parameters on localhost redirects
- Check proxy configuration if behind a corporate proxy
- Log full callback params when debugging to see what the local server received
When it happens
Trigger: Callback URL hit directly by the user's browser (manual navigation) with no query params; partial redirects where Google dropped the code; a proxy or browser extension stripping query parameters; state/fragment confusion in custom redirect handling.
Common situations: User bookmarking/pasting the localhost callback URL into a fresh tab; aggressive privacy extensions rewriting the redirect; running the flow behind a corporate proxy that mangles query strings.
Related errors
- No authorization code received
- No authorization code received
- Vertex: failed to mint access token from Service Account JSO
- Vertex: failed to refresh access token from ADC JSON (author
- loadCodeAssist failed: HTTP ${response.status} ${errorText.s
AI-assisted analysis of decolua/9router@90b52e06ff (2026-08-30).
Data as JSON: /api/errors/3ba196edc8dbab1f.
Report an issue: GitHub.