Refactor server code (#407)

هذا الالتزام موجود في:
Thomas Miceli
2025-01-20 01:57:39 +01:00
ملتزم من قبل GitHub
الأصل 4c5a7bda63
التزام f935ee1a7e
69 ملفات معدلة مع 4357 إضافات و3337 حذوفات

عرض الملف

@@ -0,0 +1,17 @@
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
}