Skip to content

Instantly share code, notes, and snippets.

@dadair-ca
Created September 5, 2015 21:54
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 dadair-ca/f7983b15f63773340151 to your computer and use it in GitHub Desktop.
Save dadair-ca/f7983b15f63773340151 to your computer and use it in GitHub Desktop.
registration
(defn- register
[db mailer email password]
(if (users/valid? email password)
(if (users/taken? db email)
(response/bad-request {:errors [{:message "That email is taken."}]})
(do (users/do-create! db email password)
(users/notify mailer email activate-subject activate-text)
(response/ok (auth/authenticate email))))
(response/bad-request {:errors [{:message errors/invalid-creds}]})))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment