Skip to content

Commit

Permalink
Verification moved to correct method
Browse files Browse the repository at this point in the history
Fixes: adac68d
Related: go-gitea#21358
Related: go-gitea#18452
Author-Change-Id: IB#1126459
  • Loading branch information
pboguslawski committed Oct 24, 2022
1 parent adac68d commit 09628bb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions services/auth/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ func (s *Session) Name() string {
// object for that uid.
// Returns nil if there is no user uid stored in the session.
func (s *Session) Verify(req *http.Request, w http.ResponseWriter, store DataStore, sess SessionStore) *user_model.User {
if sess == nil {
return nil
}

user := SessionUser(sess)
if user != nil {
return user
Expand All @@ -43,6 +39,10 @@ func (s *Session) Verify(req *http.Request, w http.ResponseWriter, store DataSto

// SessionUser returns the user object corresponding to the "uid" session variable.
func SessionUser(sess SessionStore) *user_model.User {
if sess == nil {
return nil
}

// Get user ID
uid := sess.Get("uid")
if uid == nil {
Expand Down

0 comments on commit 09628bb

Please sign in to comment.