Make public subscription API follow the 'enable public' setting.
This commit is contained in:
parent
79ff7293ea
commit
a6a2b69820
1 changed files with 8 additions and 0 deletions
|
@ -482,6 +482,14 @@ func handleSubscriptionForm(c echo.Context) error {
|
||||||
// handlePublicSubscription handles subscription requests coming from public
|
// handlePublicSubscription handles subscription requests coming from public
|
||||||
// API calls.
|
// API calls.
|
||||||
func handlePublicSubscription(c echo.Context) error {
|
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)
|
hasOptin, err := processSubForm(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue