From a3a87f54df7dd8d691f7934b92b943125be0cc5f Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Fri, 27 Dec 2013 10:26:50 +0100 Subject: [PATCH] Minor fixes. --- src/main.coffee | 1 + src/xo.coffee | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.coffee b/src/main.coffee index 3a6e69e83..c39c91eac 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -69,6 +69,7 @@ $handleJsonRpcCall = (api, session, encodedRequest) -> catch error # If it is not a valid API error, hides it with a generic server error. unless ($_.isObject error) and (error not instanceof Error) + console.error error.stack ? error error = $API.err.SERVER_ERROR formatError error diff --git a/src/xo.coffee b/src/xo.coffee index 36586f62c..f4f460280 100644 --- a/src/xo.coffee +++ b/src/xo.coffee @@ -77,7 +77,7 @@ class $User extends $Model # Checks the password and updates the hash if necessary. checkPassword: (password) -> - hash = @get 'hash' + hash = @get 'pw_hash' unless $verifyHash password, hash return false @@ -126,12 +126,12 @@ class $XO @tokens = new $Tokens { connection: redis prefix: 'xo:token' - indexes: ['host'] + indexes: ['user_id'] } @users = new $Users { connection: redis prefix: 'xo:user' - indexes: ['host'] + indexes: ['email'] } # Proxies tokens/users related events to XO and removes tokens