Fix updating sessions after logout session

This commit is contained in:
Stian Thorgersen 2014-05-22 14:51:36 +01:00
parent 74e2bfd9bd
commit 86ad7292af
2 changed files with 10 additions and 11 deletions

View file

@ -107,7 +107,7 @@ module.controller('UserSessionsCtrl', function($scope, realm, user, sessions, Us
$scope.logoutAll = function() {
UserLogout.save({realm : realm.realm, user: user.username}, function () {
Notifications.success('Logged out user in all applications');
UserSessions.get({realm: realm.realm, user: user.username}, function(updated) {
UserSessions.query({realm: realm.realm, user: user.username}, function(updated) {
$scope.sessions = updated;
})
});
@ -116,9 +116,9 @@ module.controller('UserSessionsCtrl', function($scope, realm, user, sessions, Us
$scope.logoutSession = function(sessionId) {
console.log('here in logoutSession');
UserSessionLogout.delete({realm : realm.realm, session: sessionId}, function() {
Notifications.success('Logged out session');
UserSessions.get({realm: realm.realm, user: user.username}, function(updated) {
UserSessions.query({realm: realm.realm, user: user.username}, function(updated) {
$scope.sessions = updated;
Notifications.success('Logged out session');
})
});
}

View file

@ -38,19 +38,18 @@
<td>{{session.ipAddress}}</td>
<td>{{session.start | date:'medium'}}</td>
<td>{{session.lastAccess | date:'medium'}}</td>
<td><ul style="list-style: none; ">
<li data-ng-repeat="app in session.applications">
<td>
<div data-ng-repeat="app in session.applications">
<a href="#/realms/{{realm.realm}}/applications/{{app}}/sessions">{{app}}</a>
</li>
</div>
</ul>
</td>
<td><ul style="list-style: none; ">
<li data-ng-repeat="(clientId, clientName) in session.clients">
<td>
<div data-ng-repeat="(clientId, clientName) in session.clients">
<a href="#/realms/{{realm.realm}}/oauth-clients/{{clientId}}">{{clientName}}</a>
</li>
</ul>
</div>
</td>
<td><a ng-click="logoutSession(session.id)">logout</a> </td>
<td><a href="" ng-click="logoutSession(session.id)">logout</a> </td>
</tr>
</tbody>
</table>