From 5c8f6cbed06a9198ec035dd53bb28a46ba45ed79 Mon Sep 17 00:00:00 2001 From: JustSong Date: Wed, 23 Nov 2022 21:36:16 +0800 Subject: [PATCH] fix: critical bug fixed Co-authored-by: xz <471340101@qq.com> --- controller/github.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/controller/github.go b/controller/github.go index cd1aea1d8..0a7d0b189 100644 --- a/controller/github.go +++ b/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)