Worked on ease of use for non multi tenant scenarios, Closes #20

This commit is contained in:
Torkel Ödegaard
2015-01-27 15:14:53 +01:00
parent 257519490a
commit 757b185398
8 changed files with 105 additions and 33 deletions
+1 -5
View File
@@ -4,16 +4,12 @@ import (
"github.com/torkelo/grafana-pro/pkg/bus"
"github.com/torkelo/grafana-pro/pkg/middleware"
m "github.com/torkelo/grafana-pro/pkg/models"
"github.com/torkelo/grafana-pro/pkg/util"
)
// POST /api/account/signup
// POST /api/user/signup
func SignUp(c *middleware.Context, cmd m.CreateUserCommand) {
cmd.Login = cmd.Email
cmd.Salt = util.GetRandomString(10)
cmd.Rands = util.GetRandomString(10)
cmd.Password = util.EncodePassword(cmd.Password, cmd.Salt)
if err := bus.Dispatch(&cmd); err != nil {
c.JsonApiErr(500, "failed to create user", err)