Skip to content

Instantly share code, notes, and snippets.

@dark4eg
Created November 30, 2015 14:15
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 dark4eg/be9808294894e11190f9 to your computer and use it in GitHub Desktop.
Save dark4eg/be9808294894e11190f9 to your computer and use it in GitHub Desktop.
(defn login [req]
(let [username (get-in req [:params :username])
password (get-in req [:params :password])
session (:session req)
found-password (get authdata (keyword username))]
(if (and found-password (= found-password password))
(do
(let [updated-session (assoc session :identity (keyword username))]
(assoc req :session updated-session)))
(generate-response {:msg "not found user"
:value false}))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment