Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[fix] Setup command fails to re-authorize users with Github #61

Closed
wants to merge 1 commit into from

4 participants

testybot Nicholas Hance Peter Steinberger Valentino
testybot

[fix] Setup command fails to re-authorize users with Github

[Closes #60]

Nicholas Hance
Owner

lgtm

Valentino codenamev referenced this pull request from a commit
Valentino codenamev [fix] Setup command fails to re-authorize users with Github
Closes #60, #61

LGTM given by: @nhance

Squashed commit of the following:

commit 9cd8fa8
Author: Valentino <valentino@reenhanced.com>
Date:   Wed Mar 5 11:09:09 2014 -0500

    [fix] Setup command fails to re-authorize users with Github
63c0735
Valentino codenamev closed this
Valentino codenamev deleted the branch
Peter Steinberger

Perfect, that fixed my issue. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 2 deletions.
  1. +8 −2 lib/git_reflow.rb
10 lib/git_reflow.rb
View
@@ -45,8 +45,14 @@ def setup(options = {})
config.ssl = {:verify => false}
end
- authorization = github.oauth.create 'scopes' => ['repo'], 'note' => "git-reflow (#{`hostname`.strip})"
- oauth_token = authorization[:token]
+ previous_authorizations = github.oauth.all.select {|auth| auth.note == "git-reflow (#{`hostname`.strip})" }
+ if previous_authorizations.any?
+ authorization = previous_authorizations.last
+ else
+ authorization = github.oauth.create scopes: ['repo'], note: "git-reflow (#{`hostname`.strip})"
+ end
+
+ oauth_token = authorization.token
if project_only
set_oauth_token(oauth_token, local: true)
Something went wrong with that request. Please try again.