Fixed issue with custom oauth endpoint