Commit 90120b4e authored by Tim Kinnane's avatar Tim Kinnane
Browse files

fix(ldap): Remove call to missing asteroid method

- Related #20
parent 59a5ce6f
......@@ -398,9 +398,6 @@ DA:218,0
DA:221,13
DA:224,13
DA:232,1
DA:238,25
DA:239,0
DA:240,0
DA:246,25
DA:247,25
DA:252,25
......@@ -511,8 +508,8 @@ DA:585,1
DA:586,1
DA:594,1
DA:595,2
LF:173
LH:151
LF:170
LH:150
BRDA:104,0,0,27
BRDA:126,1,0,3
BRDA:126,1,1,1
......@@ -531,66 +528,60 @@ BRDA:204,7,1,1
BRDA:222,8,0,12
BRDA:222,8,1,1
BRDA:232,9,0,25
BRDA:238,10,0,0
BRDA:238,10,1,25
BRDA:241,11,0,0
BRDA:241,11,1,0
BRDA:243,12,0,0
BRDA:243,12,1,0
BRDA:248,13,0,25
BRDA:248,13,1,25
BRDA:305,14,0,0
BRDA:305,14,1,6
BRDA:359,15,0,86
BRDA:359,15,1,0
BRDA:359,16,0,86
BRDA:359,16,1,86
BRDA:361,17,0,46
BRDA:361,17,1,40
BRDA:382,18,0,1
BRDA:388,19,0,1
BRDA:388,19,1,6
BRDA:389,20,0,7
BRDA:389,20,1,7
BRDA:389,20,2,1
BRDA:389,20,3,1
BRDA:401,21,0,0
BRDA:401,21,1,13
BRDA:407,22,0,1
BRDA:407,22,1,12
BRDA:411,23,0,1
BRDA:411,23,1,11
BRDA:411,24,0,12
BRDA:411,24,1,2
BRDA:415,25,0,0
BRDA:415,25,1,11
BRDA:415,26,0,11
BRDA:415,26,1,0
BRDA:418,27,0,0
BRDA:418,27,1,11
BRDA:418,28,0,11
BRDA:418,28,1,11
BRDA:418,28,2,10
BRDA:426,29,0,1
BRDA:426,29,1,10
BRDA:426,30,0,11
BRDA:426,30,1,1
BRDA:428,31,0,1
BRDA:428,31,1,0
BRDA:432,32,0,8
BRDA:432,32,1,3
BRDA:436,33,0,0
BRDA:436,33,1,3
BRDA:501,34,0,0
BRDA:501,34,1,4
BRDA:513,35,0,0
BRDA:513,35,1,0
BRDA:532,36,0,11
BRDA:532,36,1,3
BRDA:554,37,0,5
BRDA:554,37,1,3
BRF:76
BRH:58
BRDA:248,10,0,25
BRDA:248,10,1,25
BRDA:305,11,0,0
BRDA:305,11,1,6
BRDA:359,12,0,86
BRDA:359,12,1,0
BRDA:359,13,0,86
BRDA:359,13,1,86
BRDA:361,14,0,46
BRDA:361,14,1,40
BRDA:382,15,0,1
BRDA:388,16,0,1
BRDA:388,16,1,6
BRDA:389,17,0,7
BRDA:389,17,1,7
BRDA:389,17,2,1
BRDA:389,17,3,1
BRDA:401,18,0,0
BRDA:401,18,1,13
BRDA:407,19,0,1
BRDA:407,19,1,12
BRDA:411,20,0,1
BRDA:411,20,1,11
BRDA:411,21,0,12
BRDA:411,21,1,2
BRDA:415,22,0,0
BRDA:415,22,1,11
BRDA:415,23,0,11
BRDA:415,23,1,0
BRDA:418,24,0,0
BRDA:418,24,1,11
BRDA:418,25,0,11
BRDA:418,25,1,11
BRDA:418,25,2,10
BRDA:426,26,0,1
BRDA:426,26,1,10
BRDA:426,27,0,11
BRDA:426,27,1,1
BRDA:428,28,0,1
BRDA:428,28,1,0
BRDA:432,29,0,8
BRDA:432,29,1,3
BRDA:436,30,0,0
BRDA:436,30,1,3
BRDA:501,31,0,0
BRDA:501,31,1,4
BRDA:513,32,0,0
BRDA:513,32,1,0
BRDA:532,33,0,11
BRDA:532,33,1,3
BRDA:554,34,0,5
BRDA:554,34,1,3
BRF:70
BRH:57
end_of_record
TN:
SF:/Volumes/x/code/rocketchat/Rocket.Chat.js.SDK/src/lib/log.ts
......
......@@ -213,14 +213,17 @@ function login(credentials = {
ldap: settings.ldap
}) {
let login;
if (credentials.ldap) {
log_1.logger.info(`[login] Logging in ${credentials.username} with LDAP`);
login = exports.asteroid.loginWithLDAP(credentials.email || credentials.username, credentials.password, { ldap: true, ldapOptions: credentials.ldapOptions || {} });
}
else {
log_1.logger.info(`[login] Logging in ${credentials.username}`);
login = exports.asteroid.loginWithPassword(credentials.email || credentials.username, credentials.password);
}
// if (credentials.ldap) {
// logger.info(`[login] Logging in ${credentials.username} with LDAP`)
// login = asteroid.loginWithLDAP(
// credentials.email || credentials.username,
// credentials.password,
// { ldap: true, ldapOptions: credentials.ldapOptions || {} }
// )
// } else {
log_1.logger.info(`[login] Logging in ${credentials.username}`);
login = exports.asteroid.loginWithPassword(credentials.email || credentials.username, credentials.password);
// }
return login
.then((loggedInUserId) => {
exports.userId = loggedInUserId;
......
This diff is collapsed.
......@@ -235,20 +235,20 @@ export function login (credentials: ICredentials = {
ldap: settings.ldap
}): Promise<any> {
let login: Promise<any>
if (credentials.ldap) {
logger.info(`[login] Logging in ${credentials.username} with LDAP`)
login = asteroid.loginWithLDAP(
credentials.email || credentials.username,
credentials.password,
{ ldap: true, ldapOptions: credentials.ldapOptions || {} }
)
} else {
logger.info(`[login] Logging in ${credentials.username}`)
login = asteroid.loginWithPassword(
credentials.email || credentials.username!,
credentials.password
)
}
// if (credentials.ldap) {
// logger.info(`[login] Logging in ${credentials.username} with LDAP`)
// login = asteroid.loginWithLDAP(
// credentials.email || credentials.username,
// credentials.password,
// { ldap: true, ldapOptions: credentials.ldapOptions || {} }
// )
// } else {
logger.info(`[login] Logging in ${credentials.username}`)
login = asteroid.loginWithPassword(
credentials.email || credentials.username!,
credentials.password
)
// }
return login
.then((loggedInUserId) => {
userId = loggedInUserId
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment