mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
Destroy old sessions if a user has been deleted
This commit is contained in:
parent
cf5e75e970
commit
debab7660d
8
app/views/layouts/_session_protection.html.erb
Normal file
8
app/views/layouts/_session_protection.html.erb
Normal 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
|
||||
%>
|
||||
@ -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' %>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user