Make public subscription API follow the 'enable public' setting.

This commit is contained in:
Kailash Nadh 2023-08-15 21:05:29 +05:30
parent 79ff7293ea
commit a6a2b69820

View file

@ -482,6 +482,14 @@ func handleSubscriptionForm(c echo.Context) error {
// handlePublicSubscription handles subscription requests coming from public
// API calls.
func handlePublicSubscription(c echo.Context) error {
var (
app = c.Get("app").(*App)
)
if !app.constants.EnablePublicSubPage {
return echo.NewHTTPError(http.StatusBadRequest, app.i18n.T("public.invalidFeature"))
}
hasOptin, err := processSubForm(c)
if err != nil {
return err