AuthController.js refactor