diff --git a/src/wanijo/neo4j.clj b/src/wanijo/neo4j.clj index 55b43b6..a35aea9 100644 --- a/src/wanijo/neo4j.clj +++ b/src/wanijo/neo4j.clj @@ -10,6 +10,9 @@ (defn conn! [] @conn) +(defn uuid [] + (str (java.util.UUID/randomUUID))) + (defn butiful-query [qry] (->> qry clojure.string/trim-newline diff --git a/src/wanijo/repl.clj b/src/wanijo/repl.clj index 2863f9a..28e421e 100644 --- a/src/wanijo/repl.clj +++ b/src/wanijo/repl.clj @@ -7,9 +7,11 @@ (defn create-user! [ident pw] (cypher/tquery - neo4j/conn + (neo4j/conn!) "CREATE (n:user) SET n.ident = {ident} - SET n.pw = {pw}" + SET n.pw = {pw} + SET n.uuid = {uuid}" {:ident ident - :pw (hashers/derive pw)})) + :pw (hashers/derive pw) + :uuid (neo4j/uuid)}))