Moved authentication middleware to authentication module (minor refactor)