More work on backend for user favorites

This commit is contained in:
Torkel Ödegaard
2015-01-29 12:10:34 +01:00
parent e02e60171e
commit 1d6413bfae
14 changed files with 138 additions and 59 deletions

View File

@@ -16,7 +16,7 @@ type AuthOptions struct {
}
func getRequestUserId(c *Context) int64 {
userId := c.Session.Get("userId")
userId := c.Session.Get(SESS_KEY_USERID)
if userId != nil {
return userId.(int64)
@@ -24,8 +24,8 @@ func getRequestUserId(c *Context) int64 {
// TODO: figure out a way to secure this
if c.Query("render") == "1" {
userId := c.QueryInt64("userId")
c.Session.Set("userId", userId)
userId := c.QueryInt64(SESS_KEY_USERID)
c.Session.Set(SESS_KEY_USERID, userId)
return userId
}