fixed logout

This commit is contained in:
Brad Rydzewski 2014-10-13 21:10:55 -07:00
parent ff82ed2454
commit 782914b46f
5 changed files with 15 additions and 2 deletions

View file

@ -43,6 +43,7 @@
<script src="/static/scripts/controllers/sync.js"></script> <script src="/static/scripts/controllers/sync.js"></script>
<script src="/static/scripts/controllers/main.js"></script> <script src="/static/scripts/controllers/main.js"></script>
<script src="/static/scripts/controllers/login.js"></script> <script src="/static/scripts/controllers/login.js"></script>
<script src="/static/scripts/controllers/logout.js"></script>
<script src="/static/scripts/services/auth.js"></script> <script src="/static/scripts/services/auth.js"></script>
<script src="/static/scripts/services/conf.js"></script> <script src="/static/scripts/services/conf.js"></script>
<script src="/static/scripts/services/repo.js"></script> <script src="/static/scripts/services/repo.js"></script>

View file

@ -41,7 +41,12 @@ app.config(['$routeProvider', '$locationProvider', '$httpProvider', function($ro
.when('/login', { .when('/login', {
templateUrl: '/static/views/login.html', templateUrl: '/static/views/login.html',
controller: 'LoginController', controller: 'LoginController',
title: 'Login', title: 'Login'
})
.when('/logout', {
templateUrl: '/static/views/logout.html',
controller: 'LogoutController',
title: 'Logout'
}) })
.when('/gitlab', { .when('/gitlab', {
templateUrl: '/static/views/login_gitlab.html', templateUrl: '/static/views/login_gitlab.html',

View file

@ -0,0 +1,7 @@
'use strict';
angular.module('app').controller("LogoutController", function() {
console.log("logging out")
localStorage.removeItem("access_token");
window.location.href = "/login";
});

View file

@ -7,5 +7,5 @@
<li ng-if="user.admin == true"><a href="/admin/users"><i class="fa fa-users"></i> Users</a></li> <li ng-if="user.admin == true"><a href="/admin/users"><i class="fa fa-users"></i> Users</a></li>
<li ng-if="user.admin == true"><a href="/admin/settings"><i class="fa fa-cog"></i> Settings</a></li> <li ng-if="user.admin == true"><a href="/admin/settings"><i class="fa fa-cog"></i> Settings</a></li>
</ul> </ul>
<a href="/logout" class="signout" target="_self">Signout <i class="fa fa-sign-out"></i></a> <a href="/logout" class="signout">Signout <i class="fa fa-sign-out"></i></a>
</div> </div>

View file