triangle-utils 1.4.25 → 1.4.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { CognitoIdentityProvider, NotAuthorizedException } from "@aws-sdk/client-cognito-identity-provider";
1
+ import { CognitoIdentityProvider } from "@aws-sdk/client-cognito-identity-provider";
2
2
  export class UtilsCognito {
3
3
  cognito;
4
4
  constructor(region) {
@@ -91,10 +91,7 @@ export class UtilsCognito {
91
91
  return user_id;
92
92
  }
93
93
  catch (error) {
94
- if (error instanceof NotAuthorizedException) {
95
- return undefined;
96
- }
97
- throw error;
94
+ return undefined;
98
95
  }
99
96
  }
100
97
  async get_new_token(client_id, client_secret, refresh_token) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-utils",
3
- "version": "1.4.25",
3
+ "version": "1.4.26",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "directories": {
@@ -1,4 +1,4 @@
1
- import { CognitoIdentityProvider, NotAuthorizedException } from "@aws-sdk/client-cognito-identity-provider"
1
+ import { CognitoIdentityProvider, NotAuthorizedException, UserNotFoundException } from "@aws-sdk/client-cognito-identity-provider"
2
2
 
3
3
  export class UtilsCognito {
4
4
 
@@ -94,10 +94,7 @@ export class UtilsCognito {
94
94
  const user_id = user_attribute.Value
95
95
  return user_id
96
96
  } catch (error) {
97
- if (error instanceof NotAuthorizedException) {
98
- return undefined
99
- }
100
- throw error
97
+ return undefined
101
98
  }
102
99
  }
103
100