summaryrefslogtreecommitdiff
path: root/certs/app/controllers/certs_controller.rb
blob: 977e03e26cce51ff3385908784b03cfdc8372117 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class CertsController < ApplicationController

  before_filter :logged_in_or_free_certs

  # GET /cert
  def show
    @cert = ClientCertificate.new(free: !logged_in?)
    render text: @cert.to_s, content_type: 'text/plain'
  end

  protected

  def logged_in_or_free_certs
    authorize unless APP_CONFIG[:free_certs_enabled]
  end
end