fully integrate front and back end auth, and setup middleware function to restrict routes to authorized users