mirror of
https://github.com/thomiceli/opengist.git
synced 2025-01-14 03:42:40 +00:00
17 lines
402 B
Go
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
|
|
}
|