diff --git a/doc/How-To.md b/doc/How-To.md index 3b46de5f..1ca15959 100644 --- a/doc/How-To.md +++ b/doc/How-To.md @@ -32,7 +32,7 @@ To implement login, you need to [use the session interceptor](tutorials.md#inter ```clojure (let [;; Create a unique ID - session-id (UUID/randomUUID)] + session-id (random-uuid)] ;; Store a new session in session storage (add! session-storage session-id {:session-id session-id}) ;; Make sure session-id is part of the response @@ -64,7 +64,7 @@ you already have this injected, you can modify your create session function like (let [;; Get user from database result user (-> state :response-data :db-data first) ;; Create session - session-id (UUID/randomUUID)] + session-id (random-uuid)] ;; Store the new session in session storage. Notice the addition of user. (add! session-storage session-id (assoc user :session-id session-id)) ;; Make sure session-id is part of the response @@ -82,7 +82,7 @@ Be sure to remove user's password and any other sensitive information before sto ;; Remove password for session storage (dissoc :users/password)) ;; Create session id - session-id (UUID/randomUUID)] + session-id (random-uuid)] ;; Store the new session in session storage (add! session-storage session-id (assoc user :session-id session-id)) ;; Make sure session-id is part of the response @@ -101,7 +101,7 @@ Next, we check if the credentials are correct, so we use an `if` statement. ;; Remove password for session storage (dissoc :users/password)) ;; Create session ID - session-id (UUID/randomUUID)] + session-id (random-uuid)] ;; Store the new session in session storage (add! session-storage session-id (assoc user :session-id session-id)) ;; Make sure session-id is part of the response diff --git a/doc/tutorials.md b/doc/tutorials.md index 99881d86..1194fb33 100644 --- a/doc/tutorials.md +++ b/doc/tutorials.md @@ -368,7 +368,7 @@ Adding to the previous examples: After the session addition, it updates the user's last-login value in the database." [state] (if (valid-credentials? state) - (let [new-session-id (str (UUID/randomUUID)) + (let [new-session-id (str (random-uuid)) session-backend (-> state :deps :session-backend) {:users/keys [id] :as user} (-> state :response-data :db-data first)] (remove-from-session-store! session-backend id) @@ -584,7 +584,7 @@ ping: (defn ping [deps] (let [channel (get-in deps [:events-channel :channel])] (async/>!! channel {:type :ping - :id (str (UUID/randomUUID)) + :id (str (random-uuid)) :timestamp (.getTime (Date.))}))) (defn ->system diff --git a/docs/0.3.0/How-To.html b/docs/0.3.0/How-To.html index 7e35654c..31bff972 100644 --- a/docs/0.3.0/How-To.html +++ b/docs/0.3.0/How-To.html @@ -22,7 +22,7 @@
To implement login, you need to use the session interceptor in
(let [;; Create a unique ID
- session-id (UUID/randomUUID)]
+ session-id (random-uuid)]
;; Store a new session in session storage
(add! session-storage session-id {:session-id session-id})
;; Make sure session-id is part of the response
@@ -45,7 +45,7 @@ Login implem
(let [;; Get user from database result
user (-> state :response-data :db-data first)
;; Create session
- session-id (UUID/randomUUID)]
+ session-id (random-uuid)]
;; Store the new session in session storage. Notice the addition of user.
(add! session-storage session-id (assoc user :session-id session-id))
;; Make sure session-id is part of the response
@@ -60,7 +60,7 @@ Login implem
;; Remove password for session storage
(dissoc :users/password))
;; Create session id
- session-id (UUID/randomUUID)]
+ session-id (random-uuid)]
;; Store the new session in session storage
(add! session-storage session-id (assoc user :session-id session-id))
;; Make sure session-id is part of the response
@@ -76,7 +76,7 @@ Login implem
;; Remove password for session storage
(dissoc :users/password))
;; Create session ID
- session-id (UUID/randomUUID)]
+ session-id (random-uuid)]
;; Store the new session in session storage
(add! session-storage session-id (assoc user :session-id session-id))
;; Make sure session-id is part of the response
@@ -282,4 +282,4 @@ Data ownership
(-> state
(assoc :query (delete-query state))
(assoc-in [:request-data :restriction-fn] restriction-fn))))
-