Skip to content

Commit

Permalink
Make public subscription API follow the 'enable public' setting.
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Aug 15, 2023
1 parent 79ff729 commit a6a2b69
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/public.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a6a2b69

Please sign in to comment.