Sha256: 3667c76d2cdfd0af6b1bba4931df51249ad698e33c9ca90a092151e33ac737b0

Contents?: true

Size: 539 Bytes

Versions: 21

Compression:

Stored size: 539 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # This controller allows the user to accept the cookie policy.
  class CookiePolicyController < Decidim::ApplicationController
    skip_before_action :store_current_location

    def accept
      response.set_cookie(
        Decidim.config.consent_cookie_name,
        value: "true",
        path: "/",
        expires: 1.year.from_now.utc
      )

      respond_to do |format|
        format.js
        format.html { redirect_back fallback_location: root_path }
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
decidim-core-0.25.2 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.25.1 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.25.0 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.25.0.rc4 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.25.0.rc3 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.25.0.rc2 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.25.0.rc1 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.24.3 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.23.6 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.24.2 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.23.5 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.24.1 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.24.0 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.24.0.rc2 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.23.4 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.24.0.rc1 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.23.3 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.23.2 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.23.1 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.23.1.rc1 app/controllers/decidim/cookie_policy_controller.rb