aboutsummaryrefslogtreecommitdiff
path: root/service/auth.go
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2020-02-09 13:42:16 +0000
committerr <r@freesoftwareextremist.com>2020-02-09 13:42:16 +0000
commitcfec7879e3b3fc38956f2dce0acbbeb8a578f4c1 (patch)
tree5da9a9371fd10667cd6ee68bbd07f7f0f9d8d3d3 /service/auth.go
parenta68a09a83ef2eb411e2a7a66e919f27c040c0b6a (diff)
downloadbloat-cfec7879e3b3fc38956f2dce0acbbeb8a578f4c1.tar.gz
bloat-cfec7879e3b3fc38956f2dce0acbbeb8a578f4c1.zip
Add poll support
Currenlty only voting is possible.
Diffstat (limited to 'service/auth.go')
-rw-r--r--service/auth.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/service/auth.go b/service/auth.go
index 6c71439..4c5b38b 100644
--- a/service/auth.go
+++ b/service/auth.go
@@ -250,6 +250,19 @@ func (s *as) UnRetweet(ctx context.Context, c *model.Client, id string) (count i
return s.Service.UnRetweet(ctx, c, id)
}
+func (s *as) Vote(ctx context.Context, c *model.Client, id string,
+ choices []string) (err error) {
+ err = s.authenticateClient(ctx, c)
+ if err != nil {
+ return
+ }
+ err = checkCSRF(ctx, c)
+ if err != nil {
+ return
+ }
+ return s.Service.Vote(ctx, c, id, choices)
+}
+
func (s *as) Follow(ctx context.Context, c *model.Client, id string) (err error) {
err = s.authenticateClient(ctx, c)
if err != nil {