2017-11-05 08:16:20 +01:00

23 lines
437 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", nil)
}
return ctx.HTML(component(user))
}
}