summaryrefslogtreecommitdiffstats
path: root/services/auth/session.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-12-03 10:48:26 +0800
committerGitHub <noreply@github.com>2022-12-03 10:48:26 +0800
commit0a7d3ff786508284224ada17956a65bb759d9265 (patch)
tree4860fca95c1432ab59c6723ee2b053b1c7d6779d /services/auth/session.go
parent8698458f48eafeab21014db544aa7160368856e1 (diff)
downloadgitea-0a7d3ff786508284224ada17956a65bb759d9265.tar.gz
gitea-0a7d3ff786508284224ada17956a65bb759d9265.zip
refactor some functions to support ctx as first parameter (#21878)
Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'services/auth/session.go')
-rw-r--r--services/auth/session.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/services/auth/session.go b/services/auth/session.go
index f35fad1a0c..ef2c35d58a 100644
--- a/services/auth/session.go
+++ b/services/auth/session.go
@@ -6,6 +6,7 @@ package auth
import (
"net/http"
+ "code.gitea.io/gitea/models/db"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/log"
)
@@ -55,7 +56,7 @@ func SessionUser(sess SessionStore) *user_model.User {
}
// Get user object
- user, err := user_model.GetUserByID(id)
+ user, err := user_model.GetUserByID(db.DefaultContext, id)
if err != nil {
if !user_model.IsErrUserNotExist(err) {
log.Error("GetUserById: %v", err)