1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00
heartcombo--devise/lib/devise/hooks/csrf_cleaner.rb
Jon Phenow d47c370916 * Allows CSRF cleanup to be turned off for certain strategy types
* Defaults Authenticatable CSRF cleanup
2014-05-15 09:16:31 -05:00

7 lines
347 B
Ruby

Warden::Manager.after_authentication do |record, warden, options|
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
warden.request.session.try(:delete, :_csrf_token)
end
end