         @app.login = @params['login']
         @app.password = @params['password']
         $.ajax '/api/v1/authentication',
-            beforeSend: (r) =>
-                r.setRequestHeader 'Authorization', makeBasicAuth @app.login, @app.password
+            beforeSend: addAuthHeader
             success: (r) =>
                 @app.user = r.authentication.user
                 @app.trigger 'authentication'

    @login = undefined
    @password = undefined

    # Index
    @get '/', ->
        @$element().html 'Haha, this is the index :)'

            false

    # Clear the authentication status when we type
    $('#form-authenticate input').bind 'input', ->
        $('#form-authenticate').removeClass 'success fail'
        $('#userbar').empty()

    # Todo: .live is deprecated
    $('tbody tr').live 'click', ->
