Skip to content

Instantly share code, notes, and snippets.

@erez-rabih
Created April 21, 2019 06:16
Show Gist options
  • 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