Issue #3410707 by alexpott, catch: Optimize UserAuthenticationController by remove duplicate entity queries (cherry picked from commit a3b755e7)