Browse Source

this is duplicate

Maarten van den Berg 7 years ago
parent
commit
779a1e410b
1 changed files with 3 additions and 4 deletions
  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