             send success: true, msg: "Register succeeds."
 
     createUser = () ->
-        hash = cryptPassword password
+        hash = utils.cryptPassword password
 
         user = new User
             email: email

            data.email = newEmail

        if newPassword? and newPassword.length > 0
            data.password = cryptPassword newPassword
        
        user.updateAttributes data, (err) ->
            if err

# Actions to manage authentication : login, logout, registration.
###

passport = require("passport")
redis = require("redis")
utils = require("../../lib/passport_utils")


# Returns true (key "success") if user is authenticated, false either.
