Lots of progress on account management

This commit is contained in:
Torkel Ödegaard
2014-09-21 15:01:59 +02:00
parent 19a35673fa
commit cd9306df45
12 changed files with 317 additions and 110 deletions
+3 -3
View File
@@ -26,7 +26,8 @@ func (self *HttpServer) loginPost(c *gin.Context) {
account, err := self.store.GetAccountByLogin(loginModel.Email)
if err != nil {
c.JSON(400, gin.H{"status": "some error"})
c.JSON(400, gin.H{"status": err.Error()})
return
}
if loginModel.Password != account.Password {
@@ -35,8 +36,7 @@ func (self *HttpServer) loginPost(c *gin.Context) {
}
session, _ := sessionStore.Get(c.Request, "grafana-session")
session.Values["userAccountId"] = account.Id
session.Values["usingAccountId"] = account.UsingAccountId
session.Values["accountId"] = account.Id
session.Save(c.Request, c.Writer)
var resp = &LoginResultDto{}