Fixes oath code url for livenet/testnet
This commit is contained in:
parent
71471f2aad
commit
e9b74fcddc
4 changed files with 32 additions and 30 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue