Skip to content

Commit

Permalink
Merge pull request #723 from alphagov/highlighting_problem_with_CSRF
Browse files Browse the repository at this point in the history
2ND Line: highlighting problem with CSRF authentication in support form
  • Loading branch information
GDSNewt authored Feb 28, 2020
2 parents 09bd866 + f8d7a91 commit a54693c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# Render exceptions instead of raising them
config.action_dispatch.show_exceptions = true

# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false
# Disable caching in test environment.
config.action_mailer.perform_caching = false

# Tell Action Mailer not to deliver emails to the real world.
Expand All @@ -39,4 +38,7 @@

# Raises error for missing translations
config.action_view.raise_on_missing_translations = true

# The support forms require CSRF authentication, this should be checked in the tests
config.action_controller.allow_forgery_protection = true
end
3 changes: 2 additions & 1 deletion config/initializers/session_store.rb
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Rails.application.config.session_store :disabled
Rails.application.config.session_store :cookie_store, expire_after: 14.days, secure: !(Rails.env.development? || Rails.env.test?), httponly: true

0 comments on commit a54693c

Please sign in to comment.