From c7c5823718bc1f842f1e791d96d466a46a7db88a Mon Sep 17 00:00:00 2001 From: Sammy Henningsson Date: Tue, 13 Nov 2018 14:56:07 +0100 Subject: [PATCH] Clear User.current after controller actions --- lib/sentient_user.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/sentient_user.rb b/lib/sentient_user.rb index 98a4425..153e103 100644 --- a/lib/sentient_user.rb +++ b/lib/sentient_user.rb @@ -42,6 +42,10 @@ def self.included(base) before_action do |c| User.current = c.send(:current_user) end + + after_action do |c| + User.current = nil + end } end -end \ No newline at end of file +end