     (authenticated? request)
     (-> (render (slurp (io/resource "error.html")) request)
         (assoc :status 403))
-
     ;; In other cases, redirect it user to login.
     :else
     (let [current-url (:uri request)]
       (redirect (format "/login?next=%s" current-url)))))
-
 
 ;; Create an instance of auth backend.
 

    (throw-unauthorized)
    (response (slurp (io/resource "index.html")))))


;; Global var that stores valid users with their
;; respective passwords.

(def authdata {:admin "secret"
               :test "secret"})

;; Login page controller
;; It returns a login page on get requests.


  (POST "/login" [] login-authenticate)
  (GET "/logout" [] logout))

;; User defined unauthorized handler
;; This function is responsible for handling unauthorized requests.
;; (When unauthorized exception is raised by some handler)

(defn unauthorized-handler
