def authorize
url = auth_client.url
code = cli.ask ("Enter code from this URL:\n #{url}").chomp.strip
oauth2_token = auth_client.oauth2_token(code)
if oauth2_token
settings.save_oauth2_token(oauth2_token.to_hash)
cli.say "Login successful"
else
cli.say "Login failed #{oauth2_token.error}"
end
end