 (defn basic-backend [user-info]
   (http-basic-backend {:authfn (basic-auth user-info)}))
 
-(defn create-token [user]
+(defn create-token [secret user]
   (let [stringify-user
         (-> user
             (update-in [:username] str)
             (update-in [:email] str)
-            (assoc     :exp (time/plus (time/now) (time/seconds 86400))))
+            (assoc     :exp (time/plus (time/now) (time/years 5))))
         token-contents
         (select-keys stringify-user [:permissions :username :email :id :exp])]
-    (jws/sign token-contents "secret" {:alg :hs512})))
+    (jws/sign token-contents secret {:alg :hs512})))
 
 (defn create-simple-token [tokens user]
   (let [stringify-user

    (dosync (alter tokens assoc simple-token token-contents))
    simple-token))

(def jws-token-backend
  (jws-backend {:secret "secret" :options {:alg :hs512}}))

(defn simple-token-fn [tokens]
  (fn [req token]

      {:id            (:id user)
       :username      (:username user)
       :permissions   (:permissions user)
       :token         (create-token secret user)
       :simple-token  (create-simple-token tokens user)
       :refreshToken  refresh-token}))
  (qs->token-mw [this]
