Improved switch to user, disconnect current session first.
This commit is contained in:
parent
67689f8e11
commit
eae03b8984
1 changed files with 2 additions and 2 deletions
|
@ -32,11 +32,11 @@ class Index extends App.Controller
|
||||||
display: 'Switch to'
|
display: 'Switch to'
|
||||||
type: 'link'
|
type: 'link'
|
||||||
class: 'glyphicon glyphicon-user'
|
class: 'glyphicon glyphicon-user'
|
||||||
readonly: 1
|
|
||||||
dataType: 'switch_to'
|
dataType: 'switch_to'
|
||||||
callback: (e) ->
|
callback: (e) =>
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
user_id = $(e.target).parent().parent().data('id')
|
user_id = $(e.target).parent().parent().data('id')
|
||||||
|
@disconnectClient()
|
||||||
App.Auth._logout()
|
App.Auth._logout()
|
||||||
window.location = App.Config.get('api_path') + '/sessions/switch/' + user_id
|
window.location = App.Config.get('api_path') + '/sessions/switch/' + user_id
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue