Skip to content

Commit 09628bb

Browse files
committed
Verification moved to correct method
Fixes: adac68d Related: go-gitea#21358 Related: go-gitea#18452 Author-Change-Id: IB#1126459
1 parent adac68d commit 09628bb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

services/auth/session.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ func (s *Session) Name() string {
3030
// object for that uid.
3131
// Returns nil if there is no user uid stored in the session.
3232
func (s *Session) Verify(req *http.Request, w http.ResponseWriter, store DataStore, sess SessionStore) *user_model.User {
33-
if sess == nil {
34-
return nil
35-
}
36-
3733
user := SessionUser(sess)
3834
if user != nil {
3935
return user
@@ -43,6 +39,10 @@ func (s *Session) Verify(req *http.Request, w http.ResponseWriter, store DataSto
4339

4440
// SessionUser returns the user object corresponding to the "uid" session variable.
4541
func SessionUser(sess SessionStore) *user_model.User {
42+
if sess == nil {
43+
return nil
44+
}
45+
4646
// Get user ID
4747
uid := sess.Get("uid")
4848
if uid == nil {

0 commit comments

Comments
 (0)