Merge pull request #558 from bradrydzewski/master

fixed logout now that we've moved to JWT tokens
This commit is contained in:
Brad Rydzewski 2014-10-13 21:15:36 -07:00
commit 90d8ba3941
6 changed files with 15 additions and 4 deletions

View file

@ -43,6 +43,7 @@
<script src="/static/scripts/controllers/sync.js"></script>
<script src="/static/scripts/controllers/main.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/conf.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', {
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',

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/settings"><i class="fa fa-cog"></i> Settings</a></li>
</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>

View file

View file

@ -66,7 +66,6 @@ func (c *Channel) start() {
case sub := <-c.unsubscribe:
delete(c.subscriptions, sub)
close(sub.send)
log.Println("usubscribed to subscription")
case sub := <-c.subscribe:
c.subscriptions[sub] = true
@ -118,7 +117,6 @@ func replay(s *Subscription, history []interface{}) {
}
func (c *Channel) stop() {
log.Println("subscription stopped")
for sub := range c.subscriptions {
sub.Close()
}