From afccec103786d442601a716f06e77e95bddd0fb9 Mon Sep 17 00:00:00 2001 From: Konstantin Haase Date: Sat, 28 Jul 2012 19:48:53 +0200 Subject: [PATCH] use AccessToken --- lib/travis/api/app/endpoint/authorization.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/travis/api/app/endpoint/authorization.rb b/lib/travis/api/app/endpoint/authorization.rb index 3a37c81b..a6b9cdd9 100644 --- a/lib/travis/api/app/endpoint/authorization.rb +++ b/lib/travis/api/app/endpoint/authorization.rb @@ -78,10 +78,8 @@ class Travis::Api::App data.gsub(/\s/,'').split(',') if data end - def generate_token - token = SecureRandom.urlsafe_base64(64) - scopes = parse_scopes(params[:scope]) || Array(settings.default_scope) - token + def generate_token(user) + AccessToken.create(user: user).token end def acceptable?(scopes)