Convert Auth to constructor and add event emitter
Fix middleware path
Add test for deserialized event