You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
send explicit topup_success or subscription_success events plus shared payment_success
add server-side api_key_created, cli_key_created, and successful playground_used activation events
batch related payment events in one GA4 Measurement Protocol request
Validation
go test ./service -run 'TestDeliverPaymentAnalyticsEvent' -count=1\n- full controller suite has an unrelated existing pricing fixture failure: failed to build public website pricing: invalid internal ratio
if (data.status === 'succeeded') return data
if (data.status === 'failed') throw new Error('Generation failed')
throw new Error(`Unexpected task status: ${data.status}`)
Symptom: Google credential selection completed, but the browser returned to /sign-in?redirect=%2Fdashboard.
Evidence: Cloud Run request trace showed POST /api/oauth/google/one-tap returned 303; the failure helper would redirect to /sign-in?provider=google, so token validation was not the failing branch. The observed URL therefore came from /dashboard rejecting the missing session.
Root cause: the credential is posted cross-site from accounts.google.com; redirecting directly from that POST to /dashboard keeps the navigation in a cross-site redirect chain, so the global SameSite=Strict session cookie is withheld.
Fix (4305d5807): keep the global Strict cookie policy, but return a no-store same-origin HTML success document that starts a fresh navigation to the validated internal return path. Return paths remain sanitized and are HTML-escaped.
Validation: go test ./controller -run TestGoogleOneTap -count=1 passes; staging build, candidate health check, 100% traffic promotion, and final health check succeeded in Actions run 31746392545. Final Google account selection requires an interactive staging check.
Follow-up to #718 (comment) — controller/token.go CLI classification findings
Resolved in dac907f99:
cli_key_created is now derived from the persisted server-side marker Token.Source == model.TokenSourceCLI, not the display name.
The public AddToken and EnsureInitialToken paths now drop client-supplied source, device_id_hash, client_name, client_version, and last_used_client_at, so callers cannot forge CLI provenance by posting source: "cli".
The dedicated CLI device authorization path uses a separate trusted builder that preserves the server-populated CLI metadata.
A manually created key named Flatkey CLI is therefore recorded as api_key_created; a CLI token remains cli_key_created even if renamed.
Validation: go test ./controller -run 'Test(TokenActivationEventName|BuildTokenForInsert|CliDeviceAuthorization)' -count=1 passed.
Follow-up to the latest One Tap review: fixed in 2615c0c62.
The finding was valid: the already-authenticated branch passed {already_logged_in: true} through the same HTML renderer used for a newly authenticated user, which could overwrite localStorage.user and leave uid/permissions inconsistent.
The suggested broad gin.H type check was not used because the normal successful login payload is also map-shaped. Instead, the already-authenticated branch is explicit: JSON clients still receive {already_logged_in: true}, while the browser response preserves the existing user/uid storage and only starts the required fresh same-origin navigation for the Strict session cookie.
Regression coverage: TestGoogleOneTapAlreadyLoggedInPreservesStoredUser asserts no user/uid writes and verifies navigation; existing successful-login storage and escaping tests remain green.
Validation: GOCACHE=/private/tmp/flatkey-go-cache go test ./controller -run TestGoogleOneTap -count=1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
topup_successorsubscription_successevents plus sharedpayment_successapi_key_created,cli_key_created, and successfulplayground_usedactivation eventsValidation
go test ./service -run 'TestDeliverPaymentAnalyticsEvent' -count=1\n- full controller suite has an unrelated existing pricing fixture failure:failed to build public website pricing: invalid internal ratio