Skip to content

fix: generate correct user agent string for Google sign-in#2360

Open
phelix001 wants to merge 2 commits intoferdium:developfrom
phelix001:fix/google-sign-in-useragent
Open

fix: generate correct user agent string for Google sign-in#2360
phelix001 wants to merge 2 commits intoferdium:developfrom
phelix001:fix/google-sign-in-useragent

Conversation

@phelix001
Copy link

Summary

  • Replace useragent-generator library with a direct template string for building the Chrome user agent
  • The library was producing malformed UA strings with 537.36.0 instead of the correct 537.36 for AppleWebKit and Safari version tokens
  • Google's bot detection flags this non-standard format, blocking sign-in with "Couldn't sign you in - This browser or app may not be secure"

Before: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36.0 (KHTML, like Gecko) Chrome/138.0.7204.251 Safari/537.36.0
After: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.7204.251 Safari/537.36

Fixes #2324, #1414, #639

Test plan

  • TypeScript typecheck passes
  • All 81 tests pass
  • Lint, biome, prettier all pass
  • Manual: Add a Google service (Calendar, Gmail, etc.) and verify Google sign-in works without "browser not secure" error

🤖 Generated with Claude Code

phelix001 and others added 2 commits March 12, 2026 08:44
Webview sessions previously had no setPermissionRequestHandler, causing
all permissions to be auto-granted by Electron's default behavior. This
adds an explicit allowlist for safe permissions (media, notifications,
clipboard, etc.) and enables HID/USB/Serial permission checks needed for
hardware FIDO2 security key detection. Unknown permissions are denied
and logged for debugging.

Related: ferdium#1487, ferdium#2316

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The useragent-generator library produces malformed UA strings with
`537.36.0` instead of `537.36` for AppleWebKit and Safari versions.
Google's bot detection flags this as a non-standard browser, blocking
sign-in with "Couldn't sign you in - This browser or app may not be
secure."

Replace useragent-generator with a direct template string that produces
a standard Chrome UA. Fixes ferdium#2324, ferdium#1414, ferdium#639.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot sign into services via Google - "Couldn’t sign you in", "This browser or app may not be secure"

1 participant