Trying to sort out the user authentication