etyp / meteor-accounts-ldap

A Meteor package for logging in and creating users with LDAP credentials
MIT License
39 stars 23 forks source link

Potential problem #2

Closed sebakerckhof closed 9 years ago

sebakerckhof commented 9 years ago

Hello,

Let me start of by saying I haven't tested the code, since I don't have an LDAP server nearby. But I just went through the code and wondered if this isn't going to give a problem:

return {
            userId: userId,
            token: stampedToken.token
        };

In the case where the user doesn't exist, since then no stampedToken is going to be present, as it is only generated when a user already exists but it is returned in both cases...

etyp commented 9 years ago

@sebakerckhof It is initially set to null so if a user does not exist and isn't being created, it will remain null. But in general you're right, it's just sloppy code. I plan on cleaning up the server code in the coming days.