You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
synctv/server/handlers/public.go

24 lines
570 B
Go

package handlers
import (
"strings"
"github.com/gin-gonic/gin"
"github.com/synctv-org/synctv/internal/email"
"github.com/synctv-org/synctv/server/model"
)
type publicSettings struct {
EmailWhitelistEnabled bool `json:"emailWhitelistEnabled"`
EmailWhitelist []string `json:"emailWhitelist,omitempty"`
}
func Settings(ctx *gin.Context) {
ctx.JSON(200, model.NewApiDataResp(
&publicSettings{
EmailWhitelistEnabled: email.EmailSignupWhiteListEnable.Get(),
EmailWhitelist: strings.Split(email.EmailSignupWhiteList.Get(), ","),
},
))
}