update Auth_controller (code refactoring)