Commits

Marcin Kuzminski  committed 5b12cba

fixed issue with sessions that lead to redirection loops

  • Participants
  • Parent commits ef2f75e

Comments (0)

Files changed (3)

File rhodecode/controllers/login.py

                 # If they want to be remembered, update the cookie
                 if c.form_result['remember'] is not False:
                     session.cookie_expires = False
-                    session._set_cookie_values()
+                session._set_cookie_values()
                 session._update_cookie_out()
                 session.save()
 

File rhodecode/lib/auth.py

                     setattr(self, k, v)
                 self.set_authenticated()
                 is_user_loaded = True
+        else:
+            log.debug('No data in %s that could been used to log in' % self)
 
         if not is_user_loaded:
             # if we cannot authenticate user try anonymous
 
     def __call__(self, check_Location=''):
         user = request.user
+        log.debug('checking %s %s %s', self.__class__.__name__,
+                  self.required_perms, user)
         if not user:
+            log.debug('Empty request user')
             return False
         self.user_perms = user.permissions
         self.granted_for = user
-        log.debug('checking %s %s %s', self.__class__.__name__,
-                  self.required_perms, user)
 
         if self.check_permissions():
             log.debug('Permission granted %s @ %s', self.granted_for,

File rhodecode/lib/base.py

             cookie_store = CookieStoreWrapper(session.get('rhodecode_user'))
             user_id = cookie_store.get('user_id', None)
             username = get_container_username(environ, config)
-
             auth_user = AuthUser(user_id, api_key, username)
             request.user = auth_user
             self.rhodecode_user = c.rhodecode_user = auth_user