From 2cd06908955a89e9a4a849cf53c94ef5cf419814 Mon Sep 17 00:00:00 2001 From: Leonardo Merlin Date: Wed, 16 Sep 2015 21:47:01 -0300 Subject: [PATCH] Get app_id from constants --- src/app/index.constants.js | 4 ++++ src/app/pages/auth/auth.controller.js | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/app/index.constants.js b/src/app/index.constants.js index 209146a..0c5ea28 100644 --- a/src/app/index.constants.js +++ b/src/app/index.constants.js @@ -8,6 +8,10 @@ host: 'http://hom.dialoga.gov.br', image: 'http://hom.login.dialoga.gov.br' }) + .constant('APP', { + facebook_app_id: '1', + google_app_id: '4', + }) .constant('API', { token: null, articleId: { diff --git a/src/app/pages/auth/auth.controller.js b/src/app/pages/auth/auth.controller.js index 8f91561..bd5d54f 100644 --- a/src/app/pages/auth/auth.controller.js +++ b/src/app/pages/auth/auth.controller.js @@ -6,7 +6,7 @@ .controller('AuthPageController', AuthPageController); /** @ngInject */ - function AuthPageController($scope, $rootScope, $window, $location, $state, $timeout, $interval, AUTH_EVENTS, AuthService, DialogaService, Session, $log) { + function AuthPageController($scope, $rootScope, $window, $location, $state, $timeout, $interval, APP, AUTH_EVENTS, AuthService, DialogaService, Session, $log) { var vm = this; vm.$scope = $scope; @@ -16,6 +16,7 @@ vm.$state = $state; vm.$timeout = $timeout; vm.$interval = $interval; + vm.APP = APP; vm.AUTH_EVENTS = AUTH_EVENTS; vm.AuthService = AuthService; vm.DialogaService = DialogaService; @@ -216,14 +217,15 @@ AuthPageController.prototype.authWithFacebook = function() { var vm = this; - var url = 'http://login.dialoga.gov.br/plugin/oauth_client/facebook?oauth_client_popup=true&id=1'; + // var url = 'http://login.dialoga.gov.br/plugin/oauth_client/facebook?oauth_client_popup=true&id=1'; + var url = 'http://login.dialoga.gov.br/plugin/oauth_client/facebook?oauth_client_popup=true&id=' + vm.APP.facebook_app_id; vm.$window.oauthClientAction(url); }; AuthPageController.prototype.authWithGooglePlus = function() { var vm = this; - var url = 'http://login.dialoga.gov.br/plugin/oauth_client/google_oauth2?oauth_client_popup=true&id=4'; + var url = 'http://login.dialoga.gov.br/plugin/oauth_client/google_oauth2?oauth_client_popup=true&id=' + vm.APP.goople_app_id; vm.$window.oauthClientAction(url); }; })(); -- libgit2 0.21.2