Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

team auth only requires user scope now

  • Loading branch information...
commit 308027ec015a2f35bdc27991fd41cc9ffa72b734 1 parent af7e302
@atmos atmos authored
View
2  lib/sinatra/auth/github/version.rb
@@ -1,7 +1,7 @@
module Sinatra
module Auth
module Github
- VERSION = "0.5.3"
+ VERSION = "0.5.4"
end
end
end
View
2  sinatra_auth_github.gemspec
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
s.add_dependency "sinatra", "~>1.0"
s.add_dependency "yajl-ruby", "~>1.1"
s.add_dependency "rest-client", "~>1.6.1"
- s.add_dependency "warden-github", "~>0.4.4"
+ s.add_dependency "warden-github", "~>0.5.0"
s.add_development_dependency "rake"
s.add_development_dependency "rspec", "~>2.0.0"
View
17 spec/app.rb
@@ -6,6 +6,7 @@ class App < Sinatra::Base
enable :sessions
set :github_options, {
+ :scopes => "user",
:secret => ENV['GITHUB_CLIENT_SECRET'],
:client_id => ENV['GITHUB_CLIENT_ID'],
}
@@ -24,15 +25,19 @@ def repos
end
get '/orgs/:id' do
- github_public_organization_authenticate!(params['id'])
+ github_organization_authenticate!(params['id'])
"Hello There, #{github_user.name}! You have access to the #{params['id']} organization."
end
- # the scopes above need to include repo for team access :(
- # get '/teams/:id' do
- # github_team_authenticate!(params['id'])
- # "Hello There, #{github_user.name}! You have access to the #{params['id']} team."
- # end
+ get '/publicized_orgs/:id' do
+ github_publicized_organization_authenticate!(params['id'])
+ "Hello There, #{github_user.name}! You are publicly a member of the #{params['id']} organization."
+ end
+
+ get '/teams/:id' do
+ github_team_authenticate!(params['id'])
+ "Hello There, #{github_user.name}! You have access to the #{params['id']} team."
+ end
get '/logout' do
logout!
Please sign in to comment.
Something went wrong with that request. Please try again.