Skip to content

passkeys: register []any and map[string]any with encoding/gob - #263

Merged
rthellend merged 1 commit into
mainfrom
fix-passkeys-gob
Nov 4, 2026
Merged

rthellend merged 1 commit into
mainfrom
fix-passkeys-gob

Conversation

@rthellend

Copy link
Copy Markdown
Collaborator

Description

When a passkey user refreshes or registers their identity while holding an existing or expired TLSPROXYAUTH cookie, SetAuthTokenCookie sets the "th" claim to []any (unmarshaled from JSON as []interface{}). Persisting user.Claims via github.com/c2FmZQ/storage failed with 'gob: type not registered for interface: []interface {}'.

Register []any and map[string]any in passkeys.init() so arbitrary JSON-unmarshaled JWT claims can be gob-encoded into the passkey store. Also fix the redirectClaims["depth"] type assertion in HandleCallback from int to float64.

Type of change

  • New feature
  • Feature improvement
  • Bug fix
  • Documentation
  • Cleanup / refactoring
  • Other (please explain)

How is this change tested ?

  • Unit tests
  • Manual tests (explain)
  • Tests are not needed

When a passkey user refreshes or registers their identity while holding an existing or expired TLSPROXYAUTH cookie, SetAuthTokenCookie sets the "th" claim to []any (unmarshaled from JSON as []interface{}). Persisting user.Claims via github.com/c2FmZQ/storage failed with 'gob: type not registered for interface: []interface {}'.

- Register []any and map[string]any in passkeys.init() so arbitrary JSON-unmarshaled JWT claims can be gob-encoded into the passkey store.
- Fix the redirectClaims["depth"] type assertion in HandleCallback from int to float64, strip "depth" before persisting user.Claims, and propagate depth explicitly in setAuthToken.
- Prefer the authenticated passkey's email query parameter over redirectClaims["email"] during RefreshID.
@rthellend
rthellend merged commit 6f0e8a0 into main Nov 4, 2026
1 check passed
@rthellend
rthellend deleted the fix-passkeys-gob branch November 4, 2026 19:04
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.

1 participant