Passing non-existent credentials should return null user

In getUserByIdentity, passing some credentials that don't exist like "token" actually returned a valid user when it shouldn't.

This commit fixes this behaviour. 

Also reverted the previous commit which tried to fix #215 , that behaviour was also caused by this problem and seems to be fixed now.