[3.8] Fix #1554 Problem with authentication flow