Refactored authcode POST into separate method