lightapp-platform-common
Advanced tools
Comparing version 2.0.46 to 2.0.48
{ | ||
"name": "lightapp-platform-common", | ||
"version": "2.0.46", | ||
"version": "2.0.48", | ||
"description": "common utilities for lightapp platform", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -91,13 +91,13 @@ "use strict"; | ||
let _result; | ||
let cognitoUserPool = new amazon_cognito_identity_js_1.CognitoUserPool(this.cognitoUserPoolData); | ||
const userData = { | ||
Username: username, | ||
Pool: cognitoUserPool | ||
}; | ||
const cognitoUser = new amazon_cognito_identity_js_1.CognitoUser(userData); | ||
const authenticationDetails = new amazon_cognito_identity_js_1.AuthenticationDetails({ | ||
Username: username, | ||
Password: password | ||
}); | ||
try { | ||
let cognitoUserPool = new amazon_cognito_identity_js_1.CognitoUserPool(this.cognitoUserPoolData); | ||
const userData = { | ||
Username: username, | ||
Pool: cognitoUserPool | ||
}; | ||
const cognitoUser = new amazon_cognito_identity_js_1.CognitoUser(userData); | ||
const authenticationDetails = new amazon_cognito_identity_js_1.AuthenticationDetails({ | ||
Username: username, | ||
Password: password | ||
}); | ||
cognitoUser.authenticateUser(authenticationDetails, { | ||
@@ -121,4 +121,6 @@ onSuccess: (res) => { | ||
} | ||
catch (ex) { | ||
console.log('could not authenticate user:' + ex); | ||
catch (err) { | ||
_result = Result_2.getResult(Result_1.StatusCode.BAD_REQUEST, err); | ||
callBack(Result_2.getError(err, 'fail entire try in cognitoUser.authenticateUser'), _result); | ||
console.log('could not authenticate user:' + err); | ||
} | ||
@@ -125,0 +127,0 @@ } |
35571
932