Skip to content

Instantly share code, notes, and snippets.

@luebbert42
Created December 8, 2013 10:15
Show Gist options
  • Save luebbert42/7855531 to your computer and use it in GitHub Desktop.
Save luebbert42/7855531 to your computer and use it in GitHub Desktop.
# http://marvelley.com/2012/12/20/symfony2-json-responses-for-xhr-errors-and-authentication-failures/
parameters:
acme.demo.xhr_core_exception_listener.class: Acme\DemoBundle\Listener\XHRCoreExceptionListener
acme.demo.xhr_authentication_success_handler.class: Acme\DemoBundle\Handler\XHRAuthenticationSuccessHandler
acme.demo.xhr_authentication_failure_handler.class: Acme\DemoBundle\Handler\XHRAuthenticationFailureHandler
options:
services:
acme.demo.xhr_core_exception_listener:
class: "%acme.demo.xhr_core_exception_listener.class%"
tags:
- {name: kernel.event_listener, event: kernel.exception, priority: 1000}
acme.demo.xhr_authentication_success_handler:
class: "%acme.demo.xhr_authentication_success_handler.class%"
arguments: ['@security.http_utils', "%options%"]
acme.demo.xhr_authentication_failure_handler:
class: "%acme.demo.xhr_authentication_failure_handler.class%"
arguments: ['@http_kernel','@security.http_utils', "%options%", '@?logger']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment