summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/ui/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'testapi/opnfv_testapi/ui/app.js')
-rw-r--r--testapi/opnfv_testapi/ui/app.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/testapi/opnfv_testapi/ui/app.js b/testapi/opnfv_testapi/ui/app.js
index 28e5810..8c85686 100644
--- a/testapi/opnfv_testapi/ui/app.js
+++ b/testapi/opnfv_testapi/ui/app.js
@@ -124,14 +124,14 @@
.run(setup);
setup.$inject = [
- '$http', '$rootScope', '$window', '$state', 'testapiApiUrl'
+ '$http', '$rootScope', '$window', '$state', 'testapiApiUrl', "authenticate"
];
/**
* Set up the app with injections into $rootscope. This is mainly for auth
* functions.
*/
- function setup($http, $rootScope, $window, $state, testapiApiUrl) {
+ function setup($http, $rootScope, $window, $state, testapiApiUrl, authenticate) {
$rootScope.auth = {};
$rootScope.auth.doSignIn = doSignIn;
@@ -165,7 +165,11 @@
success(function (data) {
$rootScope.auth.currentUser = data;
$rootScope.auth.isAuthenticated = true;
- $rootScope.auth.projectNames = $rootScope.auth.doSubmitterCheck(data.groups);
+ if(authenticate){
+ $rootScope.auth.projectNames = $rootScope.auth.doSubmitterCheck(data.groups);
+ }else{
+ $rootScope.auth.projectNames = ["anonymous"]
+ }
}).
error(function () {
$rootScope.auth.currentUser = null;