1
0
Эх сурвалжийг харах

fix: critical bug fixed

Co-authored-by: xz <[email protected]>
JustSong 2 жил өмнө
parent
commit
5c8f6cbed0
1 өөрчлөгдсөн 4 нэмэгдсэн , 2 устгасан
  1. 4 2
      controller/github.go

+ 4 - 2
controller/github.go

@@ -167,8 +167,10 @@ func GitHubBind(c *gin.Context) {
 		})
 		return
 	}
-	id := c.GetInt("id")
-	user.Id = id
+	session := sessions.Default(c)
+	id := session.Get("id")
+	// id := c.GetInt("id")  // critical bug!
+	user.Id = id.(int)
 	user.FillUserById()
 	user.GitHubId = githubUser.Login
 	err = user.Update(false)