summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/sessions_helper.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/helpers/sessions_helper.rb b/app/helpers/sessions_helper.rb
index 54e4b0d..89e5ef3 100644
--- a/app/helpers/sessions_helper.rb
+++ b/app/helpers/sessions_helper.rb
@@ -18,7 +18,7 @@ module SessionsHelper
def current_user
@token ||= Session.hash_token(cookies[:remember_token])
@session ||= Session.find_by(token: @token)
- @current_user ||= (@session.nil? ? nil : @session.user)
+ @current_user ||= (@session.nil? ? NilUser.new : @session.user)
end
# checks if someone is currently signed in
@@ -30,7 +30,7 @@ module SessionsHelper
if signed_in?
@session.destroy
end
- @current_user = nil
+ @current_user = NilUser.new
cookies.delete(:remember_token)
end