Documentation
¶
Overview ¶
templ: version: v0.3.1001
Index ¶
- func OnlyLAN(next http.HandlerFunc) http.HandlerFunc
- type Module
- func (m *Module) AttachRoutes(router *engine.Router)
- func (m *Module) AttachWorkers(mgr *engine.ProcMgr)
- func (m *Module) CompleteLoginForMember(w http.ResponseWriter, r *http.Request, memberID int64, callbackURI string)
- func (s *Module) RenderSignupConfirmation(w http.ResponseWriter, r *http.Request, email, provider, callbackURI string)
- func (m *Module) WithAuthn(next http.HandlerFunc) http.HandlerFunc
- func (m *Module) WithLeadership(next http.HandlerFunc) http.HandlerFunc
- type TurnstileOptions
- type UserMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OnlyLAN ¶
func OnlyLAN(next http.HandlerFunc) http.HandlerFunc
OnlyLAN returns a 403 error if the request is coming from the internet.
Types ¶
type Module ¶
type Module struct {
// DiscordLoginEnabled is set by the discord module to indicate whether
// Discord-based login is available. If nil, the Discord login button is hidden.
DiscordLoginEnabled func(ctx context.Context) bool
// GoogleLoginEnabled is set by the google module to indicate whether
// Google-based login is available. If nil, the Google login button is hidden.
GoogleLoginEnabled func(ctx context.Context) bool
// contains filtered or unexported fields
}
func New ¶
func New(d *sql.DB, self *url.URL, tso *TurnstileOptions, tokens *engine.TokenIssuer) *Module
func (*Module) AttachRoutes ¶
func (*Module) AttachWorkers ¶
func (*Module) CompleteLoginForMember ¶
func (m *Module) CompleteLoginForMember(w http.ResponseWriter, r *http.Request, memberID int64, callbackURI string)
CompleteLoginForMember creates a session for the given member ID and redirects. This is used by external login providers (e.g. Discord OAuth) to finish a login flow.
func (*Module) RenderSignupConfirmation ¶
func (s *Module) RenderSignupConfirmation(w http.ResponseWriter, r *http.Request, email, provider, callbackURI string)
RenderSignupConfirmation renders the signup confirmation page. This is exported so that OAuth login modules can use it when they detect a new account.
func (*Module) WithAuthn ¶
func (m *Module) WithAuthn(next http.HandlerFunc) http.HandlerFunc
WithAuthn authenticates incoming requests, or redirects them to the login page.
func (*Module) WithLeadership ¶
func (m *Module) WithLeadership(next http.HandlerFunc) http.HandlerFunc
WithLeadership wraps WithAuthn and additionally requires the user to be a member of leadership.
type UserMetadata ¶
func GetUserMeta ¶
func GetUserMeta(ctx context.Context) *UserMetadata
GetUserMeta returns the email address set by WithAuth from the request context.