Skip to content

Commit

Permalink
LDAP: Sync password; Closes #1984
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigok committed Feb 10, 2016
1 parent d2ba3be commit 08aa707
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/rocketchat-ldap/server/ldap.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ LDAP = class LDAP {
const self = this;

if (self.options.use_custom_domain_search === true) {
let custom_domain_search;
try {
const custom_domain_search = JSON.parse(self.options.custom_domain_search);
custom_domain_search = JSON.parse(self.options.custom_domain_search);
} catch(error) {
throw new Error('Invalid Custom Domain Search JSON');
}
Expand Down
8 changes: 5 additions & 3 deletions packages/rocketchat-ldap/server/loginHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ Accounts.registerLoginHandler("ldap", function(loginRequest) {
}
});

syncUserData(user._id, ldapUser);
syncUserData(user._id, ldapUser, loginRequest.ldapPass);
Accounts.setPassword(user._id, loginRequest.ldapPass, {logout: false});
return {
userId: user._id,
token: stampedToken.token
Expand All @@ -169,7 +170,8 @@ Accounts.registerLoginHandler("ldap", function(loginRequest) {

// Create new user
var userObject = {
username: username
username: username,
password: loginRequest.ldapPass
};

let userData = getDataToSyncUserData(ldapUser);
Expand All @@ -186,7 +188,7 @@ Accounts.registerLoginHandler("ldap", function(loginRequest) {

let userId = Accounts.createUser(userObject);

syncUserData(userId, ldapUser);
syncUserData(userId, ldapUser, loginRequest.ldapPass);

let ldapUserService = {
ldap: true
Expand Down

0 comments on commit 08aa707

Please sign in to comment.