Break out auth into lib