Updated auth using middleware