summaryrefslogtreecommitdiff
path: root/examples/createable/content/song.go
diff options
context:
space:
mode:
Diffstat (limited to 'examples/createable/content/song.go')
-rw-r--r--examples/createable/content/song.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/createable/content/song.go b/examples/createable/content/song.go
index 74a6d4a..7473e91 100644
--- a/examples/createable/content/song.go
+++ b/examples/createable/content/song.go
@@ -8,6 +8,7 @@ import (
"github.com/ponzu-cms/ponzu/management/editor"
"github.com/ponzu-cms/ponzu/system/admin/user"
+ "github.com/ponzu-cms/ponzu/system/api"
"github.com/ponzu-cms/ponzu/system/item"
)
@@ -110,9 +111,7 @@ func (s *Song) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
// for example, this will check if the request was made by a CMS admin user:
if !user.IsValid(req) {
- addr := req.RemoteAddr
- err := fmt.Errorf("request rejected, invalid user. IP: %s", addr)
- return err
+ return api.ErrNoAuth
}
// you could then to data validation on the request post form, or do it in