Authentication controller

userRequired middleware
Code refactoring