Updated basic auth to use mongoose