Fixes oath code url for livenet/testnet

This commit is contained in:
Gustavo Maximiliano Cortez 2015-09-07 19:45:03 -03:00
commit e9b74fcddc
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
4 changed files with 32 additions and 30 deletions

View file

@ -4,14 +4,17 @@ angular.module('copayApp.controllers').controller('glideraController',
function($scope, $timeout, $modal, applicationService, profileService, configService, storageService, glideraService) {
var config = configService.getSync().wallet.settings;
this.authenticateUrl = glideraService.getOauthCodeUrl();
this.submitOauthCode = function(code) {
this.getAuthenticateUrl = function() {
return glideraService.getOauthCodeUrl();
};
this.submitOauthCode = function(code, glideraCredentials) {
var fc = profileService.focusedClient;
var self = this;
this.loading = true;
$timeout(function() {
glideraService.getToken(code, function(error, data) {
glideraService.getToken(code, glideraCredentials, function(error, data) {
if (data && data.access_token) {
storageService.setGlideraToken(fc.credentials.network, data.access_token, function() {
$scope.$emit('Local/GlideraTokenUpdated', data.access_token);