opengist/internal/web/handlers/auth.go
Thomas Miceli c2899ef41b wip
2025-01-11 20:17:01 +01:00

17 lines
402 B
Go

package handlers
import (
"github.com/thomiceli/opengist/internal/web/context"
)
type ContextAuthInfo struct {
Context *context.Context
}
func (auth ContextAuthInfo) RequireLogin() (bool, error) {
return auth.Context.GetData("RequireLogin") == true, nil
}
func (auth ContextAuthInfo) AllowGistsWithoutLogin() (bool, error) {
return auth.Context.GetData("AllowGistsWithoutLogin") == true, nil
}