From 782914b46f806536270f712469634c2478cadf23 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Mon, 13 Oct 2014 21:10:55 -0700 Subject: [PATCH] fixed logout --- server/app/index.html | 1 + server/app/scripts/app.js | 7 ++++++- server/app/scripts/controllers/logout.js | 7 +++++++ server/app/views/drawer.html | 2 +- server/app/views/logout.html | 0 5 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 server/app/scripts/controllers/logout.js create mode 100644 server/app/views/logout.html diff --git a/server/app/index.html b/server/app/index.html index 6e97fe66a..f6d51842f 100644 --- a/server/app/index.html +++ b/server/app/index.html @@ -43,6 +43,7 @@ + diff --git a/server/app/scripts/app.js b/server/app/scripts/app.js index 90b9f2786..5334513c2 100644 --- a/server/app/scripts/app.js +++ b/server/app/scripts/app.js @@ -41,7 +41,12 @@ app.config(['$routeProvider', '$locationProvider', '$httpProvider', function($ro .when('/login', { templateUrl: '/static/views/login.html', controller: 'LoginController', - title: 'Login', + title: 'Login' + }) + .when('/logout', { + templateUrl: '/static/views/logout.html', + controller: 'LogoutController', + title: 'Logout' }) .when('/gitlab', { templateUrl: '/static/views/login_gitlab.html', diff --git a/server/app/scripts/controllers/logout.js b/server/app/scripts/controllers/logout.js new file mode 100644 index 000000000..6004ef636 --- /dev/null +++ b/server/app/scripts/controllers/logout.js @@ -0,0 +1,7 @@ +'use strict'; + +angular.module('app').controller("LogoutController", function() { + console.log("logging out") + localStorage.removeItem("access_token"); + window.location.href = "/login"; +}); \ No newline at end of file diff --git a/server/app/views/drawer.html b/server/app/views/drawer.html index a756c22ed..a7332e705 100644 --- a/server/app/views/drawer.html +++ b/server/app/views/drawer.html @@ -7,5 +7,5 @@
  • Users
  • Settings
  • - Signout + Signout \ No newline at end of file diff --git a/server/app/views/logout.html b/server/app/views/logout.html new file mode 100644 index 000000000..e69de29bb