Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Tom listings auth #997

Merged
merged 3 commits into from
Feb 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions app/listings/listings.controller.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
import angular from 'angular'
import { loadUser } from '../services/userv3.service.js'

(function () {
'use strict'

angular.module('tc.listings').controller('ListingsCtrl', ListingsCtrl)

ListingsCtrl.$inject = ['CONSTANTS', 'logger', '$q',
'TcAuthService', 'UserService', 'UserStatsService', 'ProfileService', 'ChallengeService', 'ExternalAccountService',
'ngDialog', '$anchorScroll'
ListingsCtrl.$inject = ['CONSTANTS', 'logger', '$q','TcAuthService', 'UserService',
'UserStatsService', 'ProfileService', 'ChallengeService',
'ExternalAccountService', 'ngDialog', '$anchorScroll', '$scope'
]

function ListingsCtrl(CONSTANTS, logger, $q, TcAuthService, UserService, UserStatsService, ProfileService, ChallengeService, ExternalAccountService, ngDialog, $anchorScroll) {
function ListingsCtrl(CONSTANTS, logger, $q, TcAuthService, UserService, UserStatsService, ProfileService,
ChallengeService, ExternalAccountService, ngDialog, $anchorScroll, $scope) {

activate()

function activate() {
$scope.myChallenges = []
$scope.userProps = { isAuth: false }
logger.debug('Calling ListingsController activate()')

loadUser().then(function(token) {
// update auth flag
if(TcAuthService.isAuthenticated()) {
$scope.userProps = { isAuth: true }
}
}, function(error) {
// do nothing, just show non logged in state of navigation bar
})
}

}

})()
3 changes: 2 additions & 1 deletion app/listings/listings.jade
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
react-component(name="ChallengeFiltersExample")

<react-component name="ChallengeFiltersExample" props="userProps" watch-depth="reference"/>
Empty file modified app/listings/listings.module.js
100644 → 100755
Empty file.
Empty file modified app/listings/listings.routes.js
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"appirio-styles": "0.x.x",
"appirio-tech-ng-iso-constants": "^1.0.6",
"appirio-tech-ng-ui-components": "^2.1.2",
"appirio-tech-react-components": "appirio-tech/react-components.git#challenge-listings",
"appirio-tech-react-components": "nomo-kazza/react-components.git#challenge-listings",
"auth0-angular": "^4.1.0",
"auth0-js": "^6.8.0",
"d3": "^3.5.14",
Expand Down