23 lines
432 B
Go

package settings
import (
"net/http"
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/utils"
)
// Get settings.
func Get(component func(*arn.User) string) func(*aero.Context) string {
return func(ctx *aero.Context) string {
user := utils.GetUser(ctx)
if user == nil {
return ctx.Error(http.StatusUnauthorized, "Not logged in")
}
return ctx.HTML(component(user))
}
}