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.



43
44
45
# File 'lib/roda/plugins/csrf.rb', line 43

def csrf_field
  CSRF.field
end

#csrf_headerObject

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



48
49
50
# File 'lib/roda/plugins/csrf.rb', line 48

def csrf_header
  CSRF.header
end

#csrf_metatag(opts = {}) ⇒ Object

An html meta tag string containing the token.



53
54
55
# File 'lib/roda/plugins/csrf.rb', line 53

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

#csrf_tagObject

An html hidden input tag string containing the token.



58
59
60
# File 'lib/roda/plugins/csrf.rb', line 58

def csrf_tag
  CSRF.tag(env)
end

#csrf_tokenObject

The value of the csrf token.



63
64
65
# File 'lib/roda/plugins/csrf.rb', line 63

def csrf_token
  CSRF.token(env)
end