Basic Authentication now complete. Can register, and login using ajax. Authentication is checked using a middleware function that is located in the Authentication controller.