2017-12-21 17:36:29 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2013-08-02 21:13:15 +00:00
|
|
|
Warden::Manager.after_authentication do |record, warden, options|
|
2014-05-09 20:48:52 +00:00
|
|
|
clean_up_for_winning_strategy = !warden.winning_strategy.respond_to?(:clean_up_csrf?) ||
|
|
|
|
warden.winning_strategy.clean_up_csrf?
|
|
|
|
if Devise.clean_up_csrf_token_on_authentication && clean_up_for_winning_strategy
|
2013-08-02 21:13:15 +00:00
|
|
|
warden.request.session.try(:delete, :_csrf_token)
|
|
|
|
end
|
|
|
|
end
|