Destroy old sessions if a user has been deleted

This commit is contained in:
Andrew Brown 2013-03-11 23:54:39 -05:00
parent cf5e75e970
commit debab7660d
2 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,8 @@
<%
# Destroy old sessions if a user has been deleted
begin
User.find(session[:user])
rescue Mongoid::Errors::DocumentNotFound
session[:user] = nil
end
%>

View File

@ -5,6 +5,8 @@
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
<%= render 'layouts/session_protection' %>
</head>
<body>
<%= render 'layouts/navbar' %>