Minor fixes.

This commit is contained in:
Julien Fontanet 2013-12-27 10:26:50 +01:00
parent 8ed912913d
commit a3a87f54df
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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