class Index extends App.ControllerContent
  constructor: ->
    super
    @signout()

  signout: ->

    # remove remote session
    App.Auth.logout()

    # remove local session
    @Session.init()
    App.Event.trigger( 'ui:rerender' )

    # redirect to login 
    @navigate 'login'

App.Config.set( 'logout', Index, 'Routes' )
App.Config.set( 'Logout', { prio: 1800, parent: '#current_user', name: 'Sign out', target: '#logout', divider: true, role: [ 'Agent', 'Customer' ] }, 'NavBarRight' )
