Skip to content

Instantly share code, notes, and snippets.

@arjunblj
Created February 7, 2015 15:48
Show Gist options
  • Save arjunblj/f014ba685947cc2e223e to your computer and use it in GitHub Desktop.
Save arjunblj/f014ba685947cc2e223e to your computer and use it in GitHub Desktop.
app = angular.module('app')
app.controller('LoginController', ($scope, $stateParams) ->
$scope.oauthVenmo = ->
url_root = 'https://api.venmo.com/v1/oauth/'
ref = window.open(url_root + 'authorize?client_id=' + 2344 + '&scope=' + 'make_payments%20access_profile%20access_email%20access_phone%20access_friends' + '&response_type=token')
ref.addEventListener('loadstart', (event) ->
if (event.url).startsWith('http://localhost/callback')
$scope.url = event.url
ref.close()
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment