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);

View file

@ -113,6 +113,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.pendingTxProposalsCountForUs = null;
self.setSpendUnconfirmed();
self.glideraCredentials = null;
self.glideraToken = null;
self.glideraError = null;
self.glideraPermissions = null;
@ -839,6 +840,7 @@ console.log('[index.js:395]',txps); //TODO
self.initGlidera = function(accessToken) {
if (self.isShared) return;
self.glideraCredentials = glideraService.init(self.network);
var getToken = function(cb) {
if (accessToken) {
@ -852,7 +854,6 @@ console.log('[index.js:395]',txps); //TODO
if (err || !accessToken) return;
else {
self.glideraLoading = gettext('Connecting to Glidera...');
glideraService.init(self.network);
glideraService.getAccessTokenPermissions(accessToken, function(err, p) {
self.glideraLoading = null;
if (err) {