Skip to content

Instantly share code, notes, and snippets.

@Rhainur
Created December 8, 2014 08:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rhainur/c47bbd7391285762be88 to your computer and use it in GitHub Desktop.
Save Rhainur/c47bbd7391285762be88 to your computer and use it in GitHub Desktop.
Learning clojure
(defn find-by-credentials [email password]
(let [user (first (select users (where {:email email})))]
(if (and (some? user)
(crypt/compare password
(user :password)))
user)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment