23 lines
432 B
Go
Raw Normal View History

2017-06-18 15:16:40 +00:00
package settings
import (
2017-06-21 00:51:55 +00:00
"net/http"
2017-06-18 15:16:40 +00:00
"github.com/aerogo/aero"
2017-11-05 07:16:20 +00:00
"github.com/animenotifier/arn"
2017-06-18 15:16:40 +00:00
"github.com/animenotifier/notify.moe/utils"
)
2017-11-05 07:16:20 +00:00
// Get settings.
func Get(component func(*arn.User) string) func(*aero.Context) string {
return func(ctx *aero.Context) string {
user := utils.GetUser(ctx)
2017-06-18 15:16:40 +00:00
2017-11-05 07:16:20 +00:00
if user == nil {
2018-07-07 03:42:00 +00:00
return ctx.Error(http.StatusUnauthorized, "Not logged in")
2017-11-05 07:16:20 +00:00
}
2017-06-18 15:16:40 +00:00
2017-11-05 07:16:20 +00:00
return ctx.HTML(component(user))
}
2017-06-18 15:16:40 +00:00
}