completed auth from scratch