Class: Egalite::CSRFController

Inherits:
Controller show all
Defined in:
lib/egalite.rb

Constant Summary

Constants inherited from Controller

Egalite::Controller::MIME_TYPES

Instance Attribute Summary

Attributes inherited from Controller

#env, #log_values, #params, #req, #template_file

Instance Method Summary collapse

Methods inherited from Controller

#after_filter, #after_filter_html, #before_filter, #cookies, #db, #delegate, #errorlog, #escape_html, #file_form, #filter_on_html_load, #form, #id, #include, #link_to, #notfound, #raw, #redirect, #redirect_permanent, #send_data, #send_file, #session, #table_by_array, #tags, #url_for

Instance Method Details

#after_filter_return_value(response) ⇒ Object

right after controller



330
331
332
333
334
335
336
337
338
339
# File 'lib/egalite.rb', line 330

def after_filter_return_value(response) # right after controller
  if session and session.sstr and response.is_a?(Hash)
    response.merge(:csrf => session.sstr)
  elsif session and session.sstr and response.is_a?(Sequel::Model)
    response[:csrf] = session.sstr
    response
  else
    response
  end
end