Skip to content

Instantly share code, notes, and snippets.

@erez-rabih
Created April 21, 2019 06:16
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 erez-rabih/d7ab22dabcd313d0baea7afac4cbc9a6 to your computer and use it in GitHub Desktop.
Save erez-rabih/d7ab22dabcd313d0baea7afac4cbc9a6 to your computer and use it in GitHub Desktop.
user authentication module
(ns user-authentication)
(defn get-user-by-token [token]
(if-let [user-id (redis/get token)]
(first (db/select users (where {:id user-id})))
:unauthorized))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment