aws-user-service
Advanced tools
Comparing version 1.0.1 to 1.0.2
16
index.js
@@ -5,3 +5,4 @@ const AWS = require('aws-sdk'); | ||
constructor(authIntegrationUserPoolId) { | ||
this.authIntegrationUserPoolId = authIntegrationUserPoolId | ||
this.authIntegrationUserPoolId = authIntegrationUserPoolId; | ||
this.cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider(); | ||
} | ||
@@ -13,4 +14,13 @@ | ||
updateUserAttributes = (userId, attributeName, attributeValue) => { | ||
async getUser(userId){ | ||
const listUsersResponse = await this.cognitoidentityserviceprovider.listUsers({ | ||
UserPoolId: this.authIntegrationUserPoolId, | ||
Filter: `sub = "${userId}"`, | ||
Limit: 1 | ||
}).promise(); | ||
return listUsersResponse.Users[0]; | ||
} | ||
updateUserAttributes = async (userId, attributeName, attributeValue) => { | ||
var params = { | ||
@@ -26,4 +36,4 @@ "UserAttributes": [ | ||
} | ||
return cognitoidentityserviceprovider.adminUpdateUserAttributes(params) | ||
return this.cognitoidentityserviceprovider.adminUpdateUserAttributes(params).params() | ||
} | ||
} |
{ | ||
"name": "aws-user-service", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Contain methods to work with asw user", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
1505
30