Add session timeout page
[clamp.git] / src / main / resources / META-INF / resources / designer / scripts / authcontroller.js
index b138c96..ac89198 100644 (file)
  * limitations under the License.
  * ============LICENSE_END============================================
  * ===================================================================
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * 
  */
 
 'use strict';
 
-function AuthenticateCtrl($scope, $rootScope, $window, $resource, $http, $location, $cookies, md5) {
+function AuthenticateCtrl($scope, $rootScope, $window, $resource, $http, $location, $cookies) {
   console.log("//////////AuthenticateCtrl");
   $scope.getInclude = function() {
     console.log("getInclude011111111");
@@ -50,10 +50,9 @@ function AuthenticateCtrl($scope, $rootScope, $window, $resource, $http, $locati
       $window.localStorage.setItem("isInvalidUser", true);
       return;
     }
-    var hashpass = md5.createHash(pass);
     var headers = username ? {
       authorization: "Basic " +
-        btoa(username + ":" + hashpass)
+        btoa(username + ":" + pass)
     } : {};
     // send request to a test API with the username/password to verify the authorization
     $http.get('/restservices/clds/v1/user/testUser', {
@@ -72,5 +71,10 @@ function AuthenticateCtrl($scope, $rootScope, $window, $resource, $http, $locati
       callback && callback();
     });
   };
+  
+  $scope.logout = function() {
+      window.localStorage.removeItem("isAuth");
+      window.localStorage.removeItem("loginuser");
+  };
 
 }