@adastradev/user-management-sdk
Advanced tools
Comparing version 1.0.3 to 1.0.4-beta.1
import { ICognitoUserPoolLocator } from './ICognitoUserPoolLocator'; | ||
import * as AWS from 'aws-sdk'; | ||
import * as AWS from 'aws-sdk/global'; | ||
import { CognitoUserSession } from 'amazon-cognito-identity-js'; | ||
@@ -4,0 +4,0 @@ import { GlobalConfigInstance } from 'aws-sdk/lib/config'; |
@@ -38,3 +38,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var AWS = require("aws-sdk"); | ||
var AWS = require("aws-sdk/global"); | ||
var amazon_cognito_identity_js_1 = require("amazon-cognito-identity-js"); | ||
@@ -68,3 +68,3 @@ var proxy = require("proxy-agent"); | ||
return __awaiter(this, void 0, void 0, function () { | ||
var _a, userPool, authenticationData, userData, authenticationDetails, that; | ||
var _a, error_1, userPool, authenticationData, userData, authenticationDetails, that; | ||
return __generator(this, function (_b) { | ||
@@ -75,6 +75,14 @@ switch (_b.label) { | ||
console.log("Signing into AWS Cognito"); | ||
_b.label = 1; | ||
case 1: | ||
_b.trys.push([1, 3, , 4]); | ||
_a = this; | ||
return [4 /*yield*/, this.locator.getPoolForUsername(email)]; | ||
case 1: | ||
case 2: | ||
_a.poolData = _b.sent(); | ||
return [3 /*break*/, 4]; | ||
case 3: | ||
error_1 = _b.sent(); | ||
return [2 /*return*/, reject(error_1)]; | ||
case 4: | ||
userPool = new amazon_cognito_identity_js_1.CognitoUserPool(this.poolData); | ||
@@ -96,9 +104,9 @@ authenticationData = { | ||
that.cognitoUserSession = result; | ||
resolve(result); | ||
return resolve(result); | ||
}, | ||
onFailure: function (err) { | ||
reject(err); | ||
return reject(err); | ||
}, | ||
mfaRequired: function (codeDeliveryDetails) { | ||
reject(Error('Multi-factor auth is not currently supported')); | ||
return reject(Error('Multi-factor auth is not currently supported')); | ||
}, | ||
@@ -115,6 +123,6 @@ newPasswordRequired: function (userAttributes, requiredAttributes) { | ||
that.cognitoUserSession = result; | ||
resolve(result); | ||
return resolve(result); | ||
}, | ||
onFailure: function (err) { | ||
reject(err); | ||
return reject(err); | ||
} | ||
@@ -121,0 +129,0 @@ }); |
@@ -50,3 +50,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var api, response, result; | ||
var api, response, result, error_1; | ||
return __generator(this, function (_a) { | ||
@@ -56,4 +56,7 @@ switch (_a.label) { | ||
api = new UserManagementApi_1.UserManagementApi(process.env.USER_MANAGEMENT_URI, this.region, { type: 'None' }); | ||
_a.label = 1; | ||
case 1: | ||
_a.trys.push([1, 3, , 4]); | ||
return [4 /*yield*/, api.getUserPoolByUserName(userName)]; | ||
case 1: | ||
case 2: | ||
response = _a.sent(); | ||
@@ -66,3 +69,8 @@ result = { | ||
resolve(result); | ||
return [2 /*return*/]; | ||
return [3 /*break*/, 4]; | ||
case 3: | ||
error_1 = _a.sent(); | ||
reject(error_1); | ||
return [3 /*break*/, 4]; | ||
case 4: return [2 /*return*/]; | ||
} | ||
@@ -69,0 +77,0 @@ }); |
{ | ||
"name": "@adastradev/user-management-sdk", | ||
"version": "1.0.3", | ||
"version": "1.0.4-beta.1", | ||
"description": "Astra user management SDK for JavaScript in the browser and Node.js", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41861
548
1