From 01e19e2888110af9c24c9b1d6e3bea2fbba1f096 Mon Sep 17 00:00:00 2001 From: Konstantin Haase Date: Tue, 18 Sep 2012 22:21:38 +0200 Subject: [PATCH] use id rather than login for user --- lib/travis/api/app/endpoint/authorization.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/travis/api/app/endpoint/authorization.rb b/lib/travis/api/app/endpoint/authorization.rb index f7273db8..2885b637 100644 --- a/lib/travis/api/app/endpoint/authorization.rb +++ b/lib/travis/api/app/endpoint/authorization.rb @@ -142,7 +142,7 @@ class Travis::Api::App def user_for_github_token(token) data = GH.with(token: token.to_s) { GH['user'] } scopes = parse_scopes data.headers['x-oauth-scopes'] - user = User.find_by_login(data['login']) + user = User.find_by_github_id(data['id']) halt 403, 'not a Travis user' if user.nil? halt 403, 'insufficient access' unless acceptable? scopes