Created
September 5, 2015 21:54
-
-
Save dadair-ca/f7983b15f63773340151 to your computer and use it in GitHub Desktop.
registration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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