Sha256: 4643fcb69b638d928e5d7fbe217d16ca8c61ed3bc79dd430dd5a0c902d963bf3

Contents?: true

Size: 426 Bytes

Versions: 32

Compression:

Stored size: 426 Bytes

Contents

# frozen_string_literal: true

module WCC::Contentful::App::PreviewPassword
  def preview?
    # check ApplicationController for a :preview? method
    return super if defined?(super)

    @preview ||=
      if preview_password.present?
        params[:preview]&.chomp == preview_password.chomp
      else
        false
      end
  end

  def preview_password
    WCC::Contentful::App.configuration.preview_password
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
wcc-contentful-app-1.7.1 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.7.0 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.6.2 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.6.1 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.6.0 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.5.1 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.5.0 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.5.0.rc1 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.4.0 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.4.0.rc3 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.4.0.rc2 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.3.2 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.4.0.rc1 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.3.1 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.3.0 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.2.1 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.2.0 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.1.2 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.1.1 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.1.0 app/models/concerns/wcc/contentful/app/preview_password.rb