   (:require [secretary.core :as secretary :include-macros true]
             [reagent.core :as reagent]
             [ajax.core :refer [GET]]
+            [rmfu-ui.alert :refer [alert]]
             [reagent.session :as session]))
 
 (defn logout

(defn identity-token []
  (.getItem (.-localStorage js/window) "rmfu-feed-identity-token"))

(defn nav
  "Renders basic nav with an .active link"
  [active]

         (if (identity-token)
           (GET "/api/user"
                {:headers         {:identity (identity-token)}
                 :error-handler   (fn []
                                    (logout)
                                    (alert-update-display-fn "Session Expired" "Your session has expired, redirecting to the sign-in sreen")
                                    #(secretary/dispatch! "/"))
                 :response-format :json
                 :keywords?       true
                 :handler         (fn [res]
                                    (session/put! :profile res))})))
       :reagent-render
       (fn []
         [:div
         [:nav {:className "navbar navbar-light bg-faded rmfu-nav"}
         [:a {:href "/#/feed"} [:img.navbar-brand.feed-logo {:src "/images/rmfu-logo.png"}]]
          (if-let [profile (session/get :profile)]
