Reworked user auth a tiny bit to allow more error handling flexibility