Minor simplification.

This commit is contained in:
Julien Fontanet 2013-12-30 11:40:26 +01:00
parent 13b7b72865
commit d1800fe86a

View File

@ -203,12 +203,7 @@ Api.fn.session = {
}
var user = $waitPromise(this.xo.users.first({'email': p_email}));
if (!user)
{
throw Api.err.INVALID_CREDENTIAL;
}
if (!user.checkPassword(p_pass))
if (!(user && user.checkPassword(p_pass)))
{
throw Api.err.INVALID_CREDENTIAL;
}