          logged-in?   (and stored-token (not (token/expired? stored-token)))
          path         (get-in cofx [:location :path])
          auth-route?  (routes/auth-route? path)]
-     ;; FIXME this conditions are complex and partially overlapping
-     ;; Try to separate in orthogonal events
      (cond
        (and auth-route? logged-in?)
        {:db         db/default-db

                 :on-failure      [:error-message "GitHub registration failed"]}
    :db         (dissoc db :registration-token)}))

(re-frame/reg-event-fx
 :country-detect
 [(re-frame/inject-cofx :local-store "country")]

            [bouncer.validators :as validators]
            [holiday-ping-ui.db :as db]
            [holiday-ping-ui.routes :as routes]
            [holiday-ping-ui.common.events :as events]
            [holiday-ping-ui.auth.token :as token]))

;;; AUTH EVENTS
