Skip to content

Tags: anchoo2kewl/go-login

Tags

v0.2.1

Toggle v0.2.1's commit message
feat: add OnLoginSuccess callback for login event tracking

v0.2.0

Toggle v0.2.0's commit message
feat: add LinkOAuthProvider for cross-provider account linking

- Add LinkOAuthProvider to UserStore interface
- Change callback handler to link provider and sign in when email
  matches an existing account (instead of returning an error)
- Enables users to log in with any provider that shares their email

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

v0.1.0

Toggle v0.1.0's commit message
feat: initial go-login package

Standalone OAuth2 handler package for Go HTTP applications.
Supports Google and GitHub OAuth with invite-code gating,
CSRF-safe JWT state parameter, and wire-compatible JWT claims.

- Config/Validate, OAuthProviderConfig
- UserStore interface (5 methods)
- JWT: GenerateToken, ValidateToken, Claims (HS256 compatible)
- State: signed JWT as OAuth state (CSRF + invite_code)
- Provider: raw HTTP Google + GitHub (no golang.org/x/oauth2 dep)
- Handler: Initiate + Callback for Google and GitHub
- Sentinel errors: ErrWrongProvider, ErrInviteRequired, etc.
- Example: _example/main.go