modify user auth with validation and flash message