Module: Rodauth::Rails::Feature::Csrf

Extended by:
ActiveSupport::Concern
Defined in:
lib/rodauth/rails/feature/csrf.rb

Instance Method Summary collapse

Instance Method Details

#check_csrfObject

Verify Rails’ authenticity token.



22
23
24
# File 'lib/rodauth/rails/feature/csrf.rb', line 22

def check_csrf
  rails_check_csrf! if rails_controller_csrf?
end

#check_csrf?Boolean

Have Rodauth call #check_csrf automatically.

Returns:

  • (Boolean)


27
28
29
# File 'lib/rodauth/rails/feature/csrf.rb', line 27

def check_csrf?
  rails_check_csrf? if rails_controller_csrf?
end

#csrf_tagObject

Render Rails CSRF tags in Rodauth templates.



17
18
19
# File 'lib/rodauth/rails/feature/csrf.rb', line 17

def csrf_tag(*)
  rails_csrf_tag if rails_controller_csrf?
end