浏览代码

this is duplicate

Maarten van den Berg 7 年之前
父节点
当前提交
779a1e410b
共有 1 个文件被更改,包括 3 次插入4 次删除
  1. 3 4
      app/helpers/authentication_helper.rb

+ 3 - 4
app/helpers/authentication_helper.rb

40
   end
40
   end
41
 
41
 
42
   # Determine whether the user is logged in, and if so, disable the Session, then flush session cookies.
42
   # Determine whether the user is logged in, and if so, disable the Session, then flush session cookies.
43
-  def log_out
44
-    if is_logged_in? and @user_session
43
+  def log_out(session_broken = false)
44
+    if !session_broken && is_logged_in? && @user_session
45
       get_user_session
45
       get_user_session
46
 
46
 
47
       @user_session.update!(active: false)
47
       @user_session.update!(active: false)
104
 
104
 
105
     # Edge case if a session no longer exists in the database
105
     # Edge case if a session no longer exists in the database
106
     if not @user_session
106
     if not @user_session
107
-      log_out
108
-      redirect_to login_path # FIXME!
107
+      log_out(session_broken = true)
109
     end
108
     end
110
   end
109
   end
111
 
110