Skip to content
This repository was archived by the owner on Sep 10, 2026. It is now read-only.

Let a game name its own host on the web sign-in screen - #34

Merged
seenu-k merged 1 commit into
mainfrom
feature/optional-auth-domain
Aug 12, 2026
Merged

seenu-k merged 1 commit into
mainfrom
feature/optional-auth-domain

Conversation

@seenu-k

@seenu-k seenu-k commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

On the web, sign-in runs through Firebase's popup, which loads https://<authDomain>/__/auth/handler, and Google's account chooser names that host. Today every game reads:

Sign in to continue to my-project.firebaseapp.com

EngineConfig.authDomain replaces that string.

Optional, and usually left alone

Unset is the scaffolded value and the right answer for almost every game. Sign-in works on the Firebase project's own domain, needs no Firebase Hosting, and Android never shows the string at all: it signs in through the native Google flow rather than the popup, so this is web-only and cosmetic.

Why the config seam rather than an edit

firebase_options.dart is generated by FlutterFire and regenerated by configure_firebase, so a hand-edited authDomain would not survive the next run. The override is applied to the generated FirebaseOptions at startup instead, from ordinary deployment configuration, using copyWith (present in the resolved firebase_core_platform_interface 8.0.0).

It is not appHost

The value has to be a domain Firebase Hosting answers for, because that is what serves /__/auth/handler. appHost is the game's own Cloudflare Worker. They are siblings, auth.mygame.com beside mygame.com. Validated as a bare host for that reason: a value carrying its own scheme would reach Firebase as the origin it builds the popup URL from, and fail as a sign-in that never returns rather than as a configuration error.

The name is only half the branding. The product name and logo on that screen come from the OAuth consent screen in Google Cloud, which needs no code and no domain; the docs cover both halves.

Release

Additive, so a patch pre-1.0: 0.4.1. The entry is under ## [Unreleased]; cider release still has to run.

This must publish before create-eigen-game, whose companion PR raises the pinned floor to ^0.4.1 because the scaffolded main.dart passes the new parameter.

Verification

  • 231 tests pass, including two new cases: the unset path stays valid, and a URL-shaped value is rejected by name
  • dart analyze clean, dart format clean

🤖 Generated with Claude Code

Web sign-in runs through Firebase's popup, which loads
`https://<authDomain>/__/auth/handler`, so Google's account chooser reads
"Sign in to continue to my-project.firebaseapp.com". `EngineConfig.authDomain`
replaces that host.

Optional, and unset is the right answer for almost every game: sign-in works on
the Firebase project's own domain, and Android never shows the string at all,
because it signs in through the native Google flow rather than the popup.

Applied to the generated `FirebaseOptions` at startup rather than written into
`firebase_options.dart`, which FlutterFire regenerates and would drop the edit
on the next `configure_firebase`. Validated as a bare host like `appHost`: a
malformed value would otherwise reach Firebase as the origin it builds the
popup URL from, and surface as a sign-in that never returns.

It is not `appHost`. The value must be a domain Firebase Hosting answers for,
a sibling of the game's own Worker host rather than the host itself.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@seenu-k
seenu-k merged commit db01f42 into main Aug 12, 2026
3 checks passed
@seenu-k
seenu-k deleted the feature/optional-auth-domain branch August 12, 2026 07:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant