Module: Roda::RodaPlugins::Csrf::InstanceMethods

Defined in:
lib/roda/plugins/csrf.rb

Instance Method Summary collapse

Instance Method Details

#csrf_fieldObject

The name of the hidden/meta csrf tag.



56
57
58
# File 'lib/roda/plugins/csrf.rb', line 56

def csrf_field
  CSRF.field
end

#csrf_headerObject

The http header name to use for submitting csrf token via headers.



61
62
63
# File 'lib/roda/plugins/csrf.rb', line 61

def csrf_header
  CSRF.header
end

#csrf_metatag(opts = {}) ⇒ Object

An html meta tag string containing the token.



66
67
68
# File 'lib/roda/plugins/csrf.rb', line 66

def csrf_metatag(opts={})
  CSRF.metatag(env, opts)
end

#csrf_tagObject

An html hidden input tag string containing the token.



71
72
73
# File 'lib/roda/plugins/csrf.rb', line 71

def csrf_tag
  CSRF.tag(env)
end

#csrf_tokenObject

The value of the csrf token.



76
77
78
# File 'lib/roda/plugins/csrf.rb', line 76

def csrf_token
  CSRF.token(env)
end