lib/jekyll_auth/auth_site.rb in jekyll-auth-2.0.0 vs lib/jekyll_auth/auth_site.rb in jekyll-auth-2.1.0

- old
+ new

@@ -1,23 +1,18 @@ class JekyllAuth class AuthSite < Sinatra::Base - configure :production do - require 'rack-ssl-enforcer' + require "rack-ssl-enforcer" use Rack::SslEnforcer if JekyllAuth.ssl? end - use Rack::Session::Cookie, { - :http_only => true, - :secret => ENV['SESSION_SECRET'] || SecureRandom.hex - } + use Rack::Session::Cookie, :http_only => true, + :secret => ENV["SESSION_SECRET"] || SecureRandom.hex - set :github_options, { - :scopes => 'read:org' - } + set :github_options, :scopes => "read:org" - ENV['WARDEN_GITHUB_VERIFIER_SECRET'] ||= SecureRandom.hex + ENV["WARDEN_GITHUB_VERIFIER_SECRET"] ||= SecureRandom.hex register Sinatra::Auth::Github use Rack::Logger include JekyllAuth::Helpers @@ -27,21 +22,21 @@ logger.info "Authentication strategy: #{authentication_strategy}" case authentication_strategy when :team - github_team_authenticate! ENV['GITHUB_TEAM_ID'] + github_team_authenticate! ENV["GITHUB_TEAM_ID"] when :teams - github_teams_authenticate! ENV['GITHUB_TEAM_IDS'].split(",") + github_teams_authenticate! ENV["GITHUB_TEAM_IDS"].split(",") when :org - github_organization_authenticate! ENV['GITHUB_ORG_NAME'] + github_organization_authenticate! ENV["GITHUB_ORG_NAME"] else raise JekyllAuth::ConfigError end end - get '/logout' do + get "/logout" do logout! - redirect '/' + redirect "/" end end end