Skip to content

Commit b42817d

Browse files
committed
fixed deleted users not being logged out automatically
logout helper from Warden::Test::Helpers doesn't actually perform the logout (so as testing lifecycle callbacks can decide when it happens)
1 parent f8f56f5 commit b42817d

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

app/helpers/application_helper.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Provides helper methods for use by views under <tt>ApplicationController</tt> (and by extension, every view).
22
module ApplicationHelper
3-
include Warden::Test::Helpers
4-
53
##
64
# Is the current user a moderator or admin on the current community?
75
# @return [Boolean]
@@ -330,7 +328,7 @@ def current_user
330328
@current_user ||= warden.authenticate(scope: :user)
331329
if @current_user&.deleted? || @current_user&.community_user&.deleted?
332330
scope = Devise::Mapping.find_scope!(:user)
333-
logout scope
331+
warden.logout(scope)
334332
@current_user = nil
335333
end
336334
@current_user

0 commit comments

Comments
 (0)