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.0.8 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.0.7 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.0.6 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.0.5 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.0.4 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.0.3 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.0.2 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.0.1 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.0.0 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.0.0.pre.rc3 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.0.0.pre.rc2 app/models/concerns/wcc/contentful/app/preview_password.rb
wcc-contentful-app-1.0.0.pre.rc1 app/models/concerns/wcc/contentful/app/preview_password.rb