added login pattern and authenticated routes