10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/dragonfly/dropbox_data_store/rake.rb', line 10
def authorize(app_key, app_secret, access_type)
session = create_new_session(app_key, app_secret)
puts "Visit this URL: #{session.get_authorize_url}"
print "And after you approved the authorization confirm it here (y/n): "
assert_answer!
session.get_access_token
dropbox_client = DropboxClient.new(session, access_type)
account_info = dropbox_client.account_info
puts <<-MESSAGE
Authorization was successful. Here you go:
access_token: #{session.access_token.key}
access_token_secret: #{session.access_token.secret}
user_id: #{account_info["uid"]}
MESSAGE
end
|