Socket
Socket
Sign inDemoInstall

@adastradev/user-management-sdk

Package Overview
Dependencies
37
Maintainers
11
Versions
115
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.2 to 1.0.3-beta.1

4

dist/AuthManager.d.ts
import { ICognitoUserPoolLocator } from './ICognitoUserPoolLocator';
import * as AWS from 'aws-sdk';
import { CognitoUserSession } from 'amazon-cognito-identity-js';

@@ -9,6 +10,7 @@ export declare class AuthManager {

private cognitoUserSession;
private iamCredentials;
constructor(locator: ICognitoUserPoolLocator, region: string);
signIn(email: string, password: string, newPassword?: string): Promise<CognitoUserSession>;
refreshCognitoCredentials(): Promise<{}>;
configureIamCredentials(): Promise<{}>;
getIamCredentials(): Promise<AWS.CognitoIdentityCredentials>;
}

@@ -115,6 +115,6 @@ "use strict";

return __awaiter(this, void 0, void 0, function () {
var cognitoIdentityCredentials, authenticator_1, that_1;
var authenticator_1, that_1;
var _this = this;
return __generator(this, function (_a) {
cognitoIdentityCredentials = AWS.config.credentials;
if (cognitoIdentityCredentials.needsRefresh()) {
if (this.iamCredentials.needsRefresh()) {
authenticator_1 = "cognito-idp." + this.region + ".amazonaws.com/" + this.poolData.UserPoolId;

@@ -132,4 +132,4 @@ that_1 = this;

// tslint:disable-next-line:no-string-literal max-line-length
cognitoIdentityCredentials.params['Logins'][authenticator_1] = newSession.getIdToken().getJwtToken();
cognitoIdentityCredentials.refresh(function (refreshIamErr) {
_this.iamCredentials.params['Logins'][authenticator_1] = newSession.getIdToken().getJwtToken();
_this.iamCredentials.refresh(function (refreshIamErr) {
if (refreshIamErr) {

@@ -153,3 +153,3 @@ console.log(refreshIamErr);

};
AuthManager.prototype.configureIamCredentials = function () {
AuthManager.prototype.getIamCredentials = function () {
return new Promise(function (resolve, reject) {

@@ -160,3 +160,3 @@ return __awaiter(this, void 0, void 0, function () {

authenticator = "cognito-idp." + this.region + ".amazonaws.com/" + this.poolData.UserPoolId;
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
this.iamCredentials = new AWS.CognitoIdentityCredentials({
IdentityPoolId: this.poolData.IdentityPoolId,

@@ -167,3 +167,3 @@ Logins: (_a = {},

});
resolve(true);
resolve(this.iamCredentials);
return [2 /*return*/];

@@ -170,0 +170,0 @@ });

{
"name": "@adastradev/user-management-sdk",
"version": "1.0.2",
"version": "1.0.3-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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc