Improved switch to user, disconnect current session first.

This commit is contained in:
Martin Edenhofer 2013-10-18 08:28:00 +02:00
parent 67689f8e11
commit eae03b8984

View file

@ -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
}