Documentation
¶
Overview ¶
templ: version: v0.3.1001
Index ¶
- type Config
- type LoginCompleteFunc
- type Module
- func (m *Module) AttachRoutes(router *engine.Router)
- func (m *Module) ConfigSpec() config.Spec
- func (m *Module) IsLoginEnabled(ctx context.Context) bool
- func (m *Module) SetConfigLoader(store *config.Store)
- func (m *Module) SetLoginCompleter(f LoginCompleteFunc)
- func (m *Module) SetSignupConfirm(f SignupConfirmFunc)
- type SignupConfirmFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ClientID string `json:"client_id" config:"label=Client ID,section=oauth,help=The Client ID from Google Cloud Console."`
ClientSecret string `json:"client_secret" config:"label=Client Secret,secret,section=oauth,help=Keep this confidential."`
}
Config holds Google OAuth-related configuration.
type LoginCompleteFunc ¶
type LoginCompleteFunc func(w http.ResponseWriter, r *http.Request, memberID int64, callbackURI string)
LoginCompleteFunc is called by the google module to finish a login flow. It receives the member ID and the callback URI to redirect to after login.
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func (*Module) AttachRoutes ¶
func (*Module) ConfigSpec ¶
ConfigSpec returns the Google configuration specification.
func (*Module) IsLoginEnabled ¶
IsLoginEnabled reports whether Google OAuth login is available.
func (*Module) SetConfigLoader ¶
SetConfigLoader sets the typed config loader for this module.
func (*Module) SetLoginCompleter ¶
func (m *Module) SetLoginCompleter(f LoginCompleteFunc)
SetLoginCompleter configures the function used to complete Google-based logins. This must be called before routes are attached.
func (*Module) SetSignupConfirm ¶
func (m *Module) SetSignupConfirm(f SignupConfirmFunc)
SetSignupConfirm configures the function used to show the signup confirmation page. This must be called before routes are attached.
type SignupConfirmFunc ¶
type SignupConfirmFunc func(w http.ResponseWriter, r *http.Request, email, provider, callbackURI string)
SignupConfirmFunc is called when no account exists for the user's email. It renders a confirmation page asking the user to confirm account creation.