diff options
Diffstat (limited to 'certs/app/controllers')
-rw-r--r-- | certs/app/controllers/certs_controller.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/certs/app/controllers/certs_controller.rb b/certs/app/controllers/certs_controller.rb index 6db270c..977e03e 100644 --- a/certs/app/controllers/certs_controller.rb +++ b/certs/app/controllers/certs_controller.rb @@ -1,11 +1,16 @@ class CertsController < ApplicationController - before_filter :authorize + before_filter :logged_in_or_free_certs # GET /cert def show - @cert = ClientCertificate.new - render :text => @cert.key + @cert.cert, :content_type => 'text/plain' + @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 |