 
 
 (defn content-section []
-  (let [current (subscribe [:ui-state :section])]
+  (let [current (subscribe [:ui-state :section])
+        token   (subscribe [:credentials :token])]
+    (if (and (nil? @token)
+             (not= :login @current))
+      (dispatch [:set-ui-section :login]))
     (condp = @current
       :login [login-form]
       :write [write-section]

         [:a {:class "navbar-brand"} "Memento"]]
        [:div {:class "collapse navbar-collapse" :id "navbar-items"}
         [:ul {:class "nav navbar-nav"}
          (if (nil? token)
            [:ul {:class "nav navbar-nav"}
             [navbar-item "Login" :login]]
            [:ul {:class "nav navbar-nav"}

        header (condp = @state
                 :write "Make a new memory"
                 :remember "Remember"
                 "")]
    (if (not-empty header)
      [:h1 {:id "forms"} header])
    ))
