From eae03b8984fca4da981f45f05f12708a9941e2eb Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 18 Oct 2013 08:28:00 +0200 Subject: [PATCH] Improved switch to user, disconnect current session first. --- app/assets/javascripts/app/controllers/users.js.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/app/controllers/users.js.coffee b/app/assets/javascripts/app/controllers/users.js.coffee index 3ea116c47..9f78c3230 100644 --- a/app/assets/javascripts/app/controllers/users.js.coffee +++ b/app/assets/javascripts/app/controllers/users.js.coffee @@ -32,11 +32,11 @@ class Index extends App.Controller display: 'Switch to' type: 'link' class: 'glyphicon glyphicon-user' - readonly: 1 dataType: 'switch_to' - callback: (e) -> + callback: (e) => e.preventDefault() user_id = $(e.target).parent().parent().data('id') + @disconnectClient() App.Auth._logout() window.location = App.Config.get('api_path') + '/sessions/switch/' + user_id }