69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
# File 'lib/boxen/preflight/creds.rb', line 69
def run
fetch_login_and_password
tokens = get_tokens
legacy_auth = tokens.detect { |a| a.note == "Boxen" && a.fingerprint == nil }
tmp_api.delete_authorization(legacy_auth.id, :headers => ) if legacy_auth
auth = tokens.detect { |a| a.note == note && a.fingerprint == fingerprint }
tmp_api.delete_authorization(auth.id, :headers => ) if auth
auth = tmp_api.create_authorization(
:note => note,
:scopes => %w(repo user),
:fingerprint => fingerprint,
:headers =>
)
config.token = auth.token
unless ok?
puts
abort "Something went terribly wrong.",
"I was able to get your OAuth token, but was unable to use it."
end
end
|