@aws-amplify/auth 4.3.20-custom-pk.94 → 4.3.20-custom-pk.98

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.
package/CHANGELOG.md CHANGED
@@ -3,219 +3,140 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [4.5.10](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.5.9...@aws-amplify/auth@4.5.10) (2022-07-21)
6
+ ## [4.6.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.6.3...@aws-amplify/auth@4.6.4) (2022-08-23)
7
7
 
8
8
  **Note:** Version bump only for package @aws-amplify/auth
9
9
 
10
+ ## [4.6.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.6.2...@aws-amplify/auth@4.6.3) (2022-08-18)
10
11
 
12
+ **Note:** Version bump only for package @aws-amplify/auth
11
13
 
14
+ ## [4.6.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.6.1...@aws-amplify/auth@4.6.2) (2022-08-16)
12
15
 
16
+ **Note:** Version bump only for package @aws-amplify/auth
13
17
 
14
- ## [4.5.9](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.5.8...@aws-amplify/auth@4.5.9) (2022-07-07)
15
-
18
+ ## [4.6.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.6.0...@aws-amplify/auth@4.6.1) (2022-08-01)
16
19
 
17
20
  ### Bug Fixes
18
21
 
19
- * **amazon-cognito-identity-js:** Missing cognito user challenge name … ([#10047](https://github.com/aws-amplify/amplify-js/issues/10047)) ([de0441b](https://github.com/aws-amplify/amplify-js/commit/de0441b4fa67409ccbc630c42890e2c58ee779fb)), closes [#6974](https://github.com/aws-amplify/amplify-js/issues/6974)
20
- * Update Auth to import JS using named export ([#10033](https://github.com/aws-amplify/amplify-js/issues/10033)) ([11b537c](https://github.com/aws-amplify/amplify-js/commit/11b537c62fee74c04e4e3b72ba43a353ba5152c9))
21
-
22
+ - **@aws-amplify/auth:** fix storage bug for auto sign in value ([#10139](https://github.com/aws-amplify/amplify-js/issues/10139)) ([06504e6](https://github.com/aws-amplify/amplify-js/commit/06504e649068f01b85392373fdf80e2ed2a6cada))
23
+ - **auth:** Unauthenticated identity throws AuthError without user … ([#10090](https://github.com/aws-amplify/amplify-js/issues/10090)) ([2ac9035](https://github.com/aws-amplify/amplify-js/commit/2ac903516ec295fbf098f6a6644000177f315184))
22
24
 
25
+ # [4.6.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.5.10...@aws-amplify/auth@4.6.0) (2022-07-28)
23
26
 
27
+ ### Features
24
28
 
29
+ - **@aws-amplify/auth:** Auto sign in after sign up ([#10126](https://github.com/aws-amplify/amplify-js/issues/10126)) ([e54617f](https://github.com/aws-amplify/amplify-js/commit/e54617f2878244f0e391d2d49f5cd2e8a8c069f9)), closes [#6320](https://github.com/aws-amplify/amplify-js/issues/6320) [#3882](https://github.com/aws-amplify/amplify-js/issues/3882) [#3631](https://github.com/aws-amplify/amplify-js/issues/3631) [#6018](https://github.com/aws-amplify/amplify-js/issues/6018)
25
30
 
26
- ## [4.5.8](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.5.7...@aws-amplify/auth@4.5.8) (2022-06-18)
31
+ ## [4.5.10](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.5.9...@aws-amplify/auth@4.5.10) (2022-07-21)
27
32
 
28
33
  **Note:** Version bump only for package @aws-amplify/auth
29
34
 
35
+ ## [4.5.9](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.5.8...@aws-amplify/auth@4.5.9) (2022-07-07)
30
36
 
37
+ ### Bug Fixes
31
38
 
39
+ - **amazon-cognito-identity-js:** Missing cognito user challenge name … ([#10047](https://github.com/aws-amplify/amplify-js/issues/10047)) ([de0441b](https://github.com/aws-amplify/amplify-js/commit/de0441b4fa67409ccbc630c42890e2c58ee779fb)), closes [#6974](https://github.com/aws-amplify/amplify-js/issues/6974)
40
+ - Update Auth to import JS using named export ([#10033](https://github.com/aws-amplify/amplify-js/issues/10033)) ([11b537c](https://github.com/aws-amplify/amplify-js/commit/11b537c62fee74c04e4e3b72ba43a353ba5152c9))
32
41
 
33
-
34
- ## [4.5.7](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.5.6...@aws-amplify/auth@4.5.7) (2022-06-15)
42
+ ## [4.5.8](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.5.7...@aws-amplify/auth@4.5.8) (2022-06-18)
35
43
 
36
44
  **Note:** Version bump only for package @aws-amplify/auth
37
45
 
46
+ ## [4.5.7](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.5.6...@aws-amplify/auth@4.5.7) (2022-06-15)
38
47
 
39
-
40
-
48
+ **Note:** Version bump only for package @aws-amplify/auth
41
49
 
42
50
  ## [4.5.6](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.5.5...@aws-amplify/auth@4.5.6) (2022-05-24)
43
51
 
44
52
  **Note:** Version bump only for package @aws-amplify/auth
45
53
 
46
-
47
-
48
-
49
-
50
54
  ## [4.5.5](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.5.4...@aws-amplify/auth@4.5.5) (2022-05-23)
51
55
 
52
56
  **Note:** Version bump only for package @aws-amplify/auth
53
57
 
54
-
55
-
56
-
57
-
58
58
  ## [4.5.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.5.3...@aws-amplify/auth@4.5.4) (2022-05-12)
59
59
 
60
60
  **Note:** Version bump only for package @aws-amplify/auth
61
61
 
62
-
63
-
64
-
65
-
66
62
  ## [4.5.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.5.2...@aws-amplify/auth@4.5.3) (2022-05-03)
67
63
 
68
64
  **Note:** Version bump only for package @aws-amplify/auth
69
65
 
70
-
71
-
72
-
73
-
74
66
  ## [4.5.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.5.1...@aws-amplify/auth@4.5.2) (2022-04-14)
75
67
 
76
68
  **Note:** Version bump only for package @aws-amplify/auth
77
69
 
78
-
79
-
80
-
81
-
82
70
  ## [4.5.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.5.0...@aws-amplify/auth@4.5.1) (2022-04-04)
83
71
 
84
72
  **Note:** Version bump only for package @aws-amplify/auth
85
73
 
86
-
87
-
88
-
89
-
90
74
  # [4.5.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.4.4...@aws-amplify/auth@4.5.0) (2022-03-28)
91
75
 
92
-
93
76
  ### Features
94
77
 
95
- * PubSub Add Options objects for all Providers and fix: Spelling error and deprecation of old exports ([#9683](https://github.com/aws-amplify/amplify-js/issues/9683)) ([b535af2](https://github.com/aws-amplify/amplify-js/commit/b535af2133b5460c6e8e2fcfd89e1fe235872c27))
96
-
97
-
98
-
99
-
78
+ - PubSub Add Options objects for all Providers and fix: Spelling error and deprecation of old exports ([#9683](https://github.com/aws-amplify/amplify-js/issues/9683)) ([b535af2](https://github.com/aws-amplify/amplify-js/commit/b535af2133b5460c6e8e2fcfd89e1fe235872c27))
100
79
 
101
80
  ## [4.4.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.4.3...@aws-amplify/auth@4.4.4) (2022-03-22)
102
81
 
103
82
  **Note:** Version bump only for package @aws-amplify/auth
104
83
 
105
-
106
-
107
-
108
-
109
84
  ## [4.4.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.4.2...@aws-amplify/auth@4.4.3) (2022-03-10)
110
85
 
111
-
112
86
  ### Bug Fixes
113
87
 
114
- * **@aws-amplify/auth:** Invalid session cleanup ([#9628](https://github.com/aws-amplify/amplify-js/issues/9628)) ([7459d54](https://github.com/aws-amplify/amplify-js/commit/7459d54ccb21576c1c5a4b45b4b72183364b681b))
115
-
116
-
117
-
118
-
88
+ - **@aws-amplify/auth:** Invalid session cleanup ([#9628](https://github.com/aws-amplify/amplify-js/issues/9628)) ([7459d54](https://github.com/aws-amplify/amplify-js/commit/7459d54ccb21576c1c5a4b45b4b72183364b681b))
119
89
 
120
90
  ## [4.4.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.4.1...@aws-amplify/auth@4.4.2) (2022-02-28)
121
91
 
122
92
  **Note:** Version bump only for package @aws-amplify/auth
123
93
 
124
-
125
-
126
-
127
-
128
94
  ## [4.4.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.4.0...@aws-amplify/auth@4.4.1) (2022-02-03)
129
95
 
130
96
  **Note:** Version bump only for package @aws-amplify/auth
131
97
 
132
-
133
-
134
-
135
-
136
98
  # [4.4.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.3.20...@aws-amplify/auth@4.4.0) (2022-01-27)
137
99
 
138
-
139
100
  ### Features
140
101
 
141
- * **@aws-amplify/auth:** Delete user API exposed ([#9428](https://github.com/aws-amplify/amplify-js/issues/9428)) ([bf3d189](https://github.com/aws-amplify/amplify-js/commit/bf3d189c9e7e14342230fca8a0cbba6972e7b42c))
142
-
143
-
144
-
145
-
102
+ - **@aws-amplify/auth:** Delete user API exposed ([#9428](https://github.com/aws-amplify/amplify-js/issues/9428)) ([bf3d189](https://github.com/aws-amplify/amplify-js/commit/bf3d189c9e7e14342230fca8a0cbba6972e7b42c))
146
103
 
147
104
  ## [4.3.20](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.3.19...@aws-amplify/auth@4.3.20) (2022-01-07)
148
105
 
149
106
  **Note:** Version bump only for package @aws-amplify/auth
150
107
 
151
-
152
-
153
-
154
-
155
108
  ## [4.3.19](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.3.18...@aws-amplify/auth@4.3.19) (2021-12-16)
156
109
 
157
110
  **Note:** Version bump only for package @aws-amplify/auth
158
111
 
159
-
160
-
161
-
162
-
163
112
  ## [4.3.18](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.3.17...@aws-amplify/auth@4.3.18) (2021-12-03)
164
113
 
165
114
  **Note:** Version bump only for package @aws-amplify/auth
166
115
 
167
-
168
-
169
-
170
-
171
116
  ## [4.3.17](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.3.16...@aws-amplify/auth@4.3.17) (2021-12-02)
172
117
 
173
118
  **Note:** Version bump only for package @aws-amplify/auth
174
119
 
175
-
176
-
177
-
178
-
179
120
  ## [4.3.16](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.3.15...@aws-amplify/auth@4.3.16) (2021-11-18)
180
121
 
181
122
  **Note:** Version bump only for package @aws-amplify/auth
182
123
 
183
-
184
-
185
-
186
-
187
124
  ## [4.3.15](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.3.14...@aws-amplify/auth@4.3.15) (2021-11-16)
188
125
 
189
126
  **Note:** Version bump only for package @aws-amplify/auth
190
127
 
191
-
192
-
193
-
194
-
195
128
  ## [4.3.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.3.13...@aws-amplify/auth@4.3.14) (2021-11-12)
196
129
 
197
130
  **Note:** Version bump only for package @aws-amplify/auth
198
131
 
199
-
200
-
201
-
202
-
203
132
  ## [4.3.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.3.12...@aws-amplify/auth@4.3.13) (2021-11-09)
204
133
 
205
134
  **Note:** Version bump only for package @aws-amplify/auth
206
135
 
207
-
208
-
209
-
210
-
211
136
  ## [4.3.12](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.3.11...@aws-amplify/auth@4.3.12) (2021-10-28)
212
137
 
213
138
  **Note:** Version bump only for package @aws-amplify/auth
214
139
 
215
-
216
-
217
-
218
-
219
140
  ## [4.3.11](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.3.10...@aws-amplify/auth@4.3.11) (2021-10-21)
220
141
 
221
142
  ### Bug Fixes
@@ -10710,6 +10710,7 @@ var dispatchAuthEvent = function dispatchAuthEvent(event, data, message) {
10710
10710
 
10711
10711
 
10712
10712
  var MAX_DEVICES = 60;
10713
+ var MAX_AUTOSIGNIN_POLLING_MS = 3 * 60 * 1000;
10713
10714
  /**
10714
10715
  * Provide authentication steps
10715
10716
  */
@@ -10727,6 +10728,7 @@ function () {
10727
10728
  this.userPool = null;
10728
10729
  this.user = null;
10729
10730
  this.oAuthFlowInProgress = false;
10731
+ this.autoSignInInitiated = false;
10730
10732
  this.Credentials = _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["Credentials"];
10731
10733
 
10732
10734
  this.wrapRefreshSessionCallback = function (callback) {
@@ -10872,6 +10874,19 @@ function () {
10872
10874
  }
10873
10875
 
10874
10876
  dispatchAuthEvent('configured', null, "The Auth category has been configured successfully");
10877
+
10878
+ if (!this.autoSignInInitiated && typeof this._storage['getItem'] === 'function') {
10879
+ var pollingInitiated = this.isTrueStorageValue('amplify-polling-started');
10880
+
10881
+ if (pollingInitiated) {
10882
+ dispatchAuthEvent('autoSignIn_failure', null, _types_Auth__WEBPACK_IMPORTED_MODULE_7__["AuthErrorTypes"].AutoSignInError);
10883
+
10884
+ this._storage.removeItem('amplify-auto-sign-in');
10885
+ }
10886
+
10887
+ this._storage.removeItem('amplify-polling-started');
10888
+ }
10889
+
10875
10890
  return this._config;
10876
10891
  };
10877
10892
  /**
@@ -10891,6 +10906,8 @@ function () {
10891
10906
  restOfAttrs[_i - 1] = arguments[_i];
10892
10907
  }
10893
10908
 
10909
+ var _a, _b, _c;
10910
+
10894
10911
  if (!this.userPool) {
10895
10912
  return this.rejectNoUserPool();
10896
10913
  }
@@ -10900,6 +10917,11 @@ function () {
10900
10917
  var attributes = [];
10901
10918
  var validationData = null;
10902
10919
  var clientMetadata;
10920
+ var autoSignIn = {
10921
+ enabled: false
10922
+ };
10923
+ var autoSignInValidationData = {};
10924
+ var autoSignInClientMetaData = {};
10903
10925
 
10904
10926
  if (params && typeof params === 'string') {
10905
10927
  username = params;
@@ -10946,6 +10968,17 @@ function () {
10946
10968
  }));
10947
10969
  });
10948
10970
  }
10971
+
10972
+ autoSignIn = (_a = params.autoSignIn) !== null && _a !== void 0 ? _a : {
10973
+ enabled: false
10974
+ };
10975
+
10976
+ if (autoSignIn.enabled) {
10977
+ this._storage.setItem('amplify-auto-sign-in', 'true');
10978
+
10979
+ autoSignInValidationData = (_b = autoSignIn.validationData) !== null && _b !== void 0 ? _b : {};
10980
+ autoSignInClientMetaData = (_c = autoSignIn.clientMetaData) !== null && _c !== void 0 ? _c : {};
10981
+ }
10949
10982
  } else {
10950
10983
  return this.rejectAuthError(_types_Auth__WEBPACK_IMPORTED_MODULE_7__["AuthErrorTypes"].SignUpError);
10951
10984
  }
@@ -10967,11 +11000,126 @@ function () {
10967
11000
  reject(err);
10968
11001
  } else {
10969
11002
  dispatchAuthEvent('signUp', data, username + " has signed up successfully");
11003
+
11004
+ if (autoSignIn.enabled) {
11005
+ _this.handleAutoSignIn(username, password, autoSignInValidationData, autoSignInClientMetaData, data);
11006
+ }
11007
+
10970
11008
  resolve(data);
10971
11009
  }
10972
11010
  }, clientMetadata);
10973
11011
  });
10974
11012
  };
11013
+
11014
+ AuthClass.prototype.handleAutoSignIn = function (username, password, validationData, clientMetadata, data) {
11015
+ this.autoSignInInitiated = true;
11016
+ var authDetails = new amazon_cognito_identity_js__WEBPACK_IMPORTED_MODULE_2__["AuthenticationDetails"]({
11017
+ Username: username,
11018
+ Password: password,
11019
+ ValidationData: validationData,
11020
+ ClientMetadata: clientMetadata
11021
+ });
11022
+
11023
+ if (data.userConfirmed) {
11024
+ this.signInAfterUserConfirmed(authDetails);
11025
+ } else if (this._config.signUpVerificationMethod === 'link') {
11026
+ this.handleLinkAutoSignIn(authDetails);
11027
+ } else {
11028
+ this.handleCodeAutoSignIn(authDetails);
11029
+ }
11030
+ };
11031
+
11032
+ AuthClass.prototype.handleCodeAutoSignIn = function (authDetails) {
11033
+ var _this = this;
11034
+
11035
+ var listenEvent = function listenEvent(_a) {
11036
+ var payload = _a.payload;
11037
+
11038
+ if (payload.event === 'confirmSignUp') {
11039
+ _this.signInAfterUserConfirmed(authDetails, listenEvent);
11040
+ }
11041
+ };
11042
+
11043
+ _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["Hub"].listen('auth', listenEvent);
11044
+ };
11045
+
11046
+ AuthClass.prototype.handleLinkAutoSignIn = function (authDetails) {
11047
+ var _this = this;
11048
+
11049
+ this._storage.setItem('amplify-polling-started', 'true');
11050
+
11051
+ var start = Date.now();
11052
+ var autoSignInPollingIntervalId = setInterval(function () {
11053
+ if (Date.now() - start > MAX_AUTOSIGNIN_POLLING_MS) {
11054
+ clearInterval(autoSignInPollingIntervalId);
11055
+ dispatchAuthEvent('autoSignIn_failure', null, 'Please confirm your account and use your credentials to sign in.');
11056
+
11057
+ _this._storage.removeItem('amplify-auto-sign-in');
11058
+ } else {
11059
+ _this.signInAfterUserConfirmed(authDetails, null, autoSignInPollingIntervalId);
11060
+ }
11061
+ }, 5000);
11062
+ };
11063
+
11064
+ AuthClass.prototype.signInAfterUserConfirmed = function (authDetails, listenEvent, autoSignInPollingIntervalId) {
11065
+ return __awaiter(this, void 0, void 0, function () {
11066
+ var user, error_1;
11067
+
11068
+ var _this = this;
11069
+
11070
+ return __generator(this, function (_a) {
11071
+ switch (_a.label) {
11072
+ case 0:
11073
+ user = this.createCognitoUser(authDetails.getUsername());
11074
+ _a.label = 1;
11075
+
11076
+ case 1:
11077
+ _a.trys.push([1, 3,, 4]);
11078
+
11079
+ return [4
11080
+ /*yield*/
11081
+ , user.authenticateUser(authDetails, this.authCallbacks(user, function (value) {
11082
+ dispatchAuthEvent('autoSignIn', value, authDetails.getUsername() + " has signed in successfully");
11083
+
11084
+ if (listenEvent) {
11085
+ _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["Hub"].remove('auth', listenEvent);
11086
+ }
11087
+
11088
+ if (autoSignInPollingIntervalId) {
11089
+ clearInterval(autoSignInPollingIntervalId);
11090
+
11091
+ _this._storage.removeItem('amplify-polling-started');
11092
+ }
11093
+
11094
+ _this._storage.removeItem('amplify-auto-sign-in');
11095
+ }, function (error) {
11096
+ logger.error(error);
11097
+
11098
+ _this._storage.removeItem('amplify-auto-sign-in');
11099
+ }))];
11100
+
11101
+ case 2:
11102
+ _a.sent();
11103
+
11104
+ return [3
11105
+ /*break*/
11106
+ , 4];
11107
+
11108
+ case 3:
11109
+ error_1 = _a.sent();
11110
+ logger.error(error_1);
11111
+ return [3
11112
+ /*break*/
11113
+ , 4];
11114
+
11115
+ case 4:
11116
+ return [2
11117
+ /*return*/
11118
+ ];
11119
+ }
11120
+ });
11121
+ });
11122
+ };
10975
11123
  /**
10976
11124
  * Send the verification code to confirm sign up
10977
11125
  * @param {String} username - The username to be confirmed
@@ -10982,6 +11130,8 @@ function () {
10982
11130
 
10983
11131
 
10984
11132
  AuthClass.prototype.confirmSignUp = function (username, code, options) {
11133
+ var _this = this;
11134
+
10985
11135
  if (!this.userPool) {
10986
11136
  return this.rejectNoUserPool();
10987
11137
  }
@@ -11009,11 +11159,27 @@ function () {
11009
11159
  if (err) {
11010
11160
  reject(err);
11011
11161
  } else {
11162
+ dispatchAuthEvent('confirmSignUp', data, username + " has been confirmed successfully");
11163
+
11164
+ var autoSignIn = _this.isTrueStorageValue('amplify-auto-sign-in');
11165
+
11166
+ if (autoSignIn && !_this.autoSignInInitiated) {
11167
+ dispatchAuthEvent('autoSignIn_failure', null, _types_Auth__WEBPACK_IMPORTED_MODULE_7__["AuthErrorTypes"].AutoSignInError);
11168
+
11169
+ _this._storage.removeItem('amplify-auto-sign-in');
11170
+ }
11171
+
11012
11172
  resolve(data);
11013
11173
  }
11014
11174
  }, clientMetadata);
11015
11175
  });
11016
11176
  };
11177
+
11178
+ AuthClass.prototype.isTrueStorageValue = function (value) {
11179
+ var item = this._storage.getItem(value);
11180
+
11181
+ return item ? item === 'true' : false;
11182
+ };
11017
11183
  /**
11018
11184
  * Resend the verification code
11019
11185
  * @param {String} username - The username to be confirmed
@@ -12689,7 +12855,7 @@ function () {
12689
12855
  logger.debug('Getting current session'); // Purposely not calling the reject method here because we don't need a console error
12690
12856
 
12691
12857
  if (!this.userPool) {
12692
- return this.rejectNoUserPool();
12858
+ return Promise.reject(new Error('No User Pool in the configuration.'));
12693
12859
  }
12694
12860
 
12695
12861
  return new Promise(function (res, rej) {
@@ -13711,7 +13877,7 @@ function () {
13711
13877
 
13712
13878
  AuthClass.prototype.rememberDevice = function () {
13713
13879
  return __awaiter(this, void 0, void 0, function () {
13714
- var currUser, error_1;
13880
+ var currUser, error_2;
13715
13881
  return __generator(this, function (_a) {
13716
13882
  switch (_a.label) {
13717
13883
  case 0:
@@ -13728,8 +13894,8 @@ function () {
13728
13894
  , 3];
13729
13895
 
13730
13896
  case 2:
13731
- error_1 = _a.sent();
13732
- logger.debug('The user is not authenticated by the error', error_1);
13897
+ error_2 = _a.sent();
13898
+ logger.debug('The user is not authenticated by the error', error_2);
13733
13899
  return [2
13734
13900
  /*return*/
13735
13901
  , Promise.reject('The user is not authenticated')];
@@ -13761,7 +13927,7 @@ function () {
13761
13927
 
13762
13928
  AuthClass.prototype.forgetDevice = function () {
13763
13929
  return __awaiter(this, void 0, void 0, function () {
13764
- var currUser, error_2;
13930
+ var currUser, error_3;
13765
13931
  return __generator(this, function (_a) {
13766
13932
  switch (_a.label) {
13767
13933
  case 0:
@@ -13778,8 +13944,8 @@ function () {
13778
13944
  , 3];
13779
13945
 
13780
13946
  case 2:
13781
- error_2 = _a.sent();
13782
- logger.debug('The user is not authenticated by the error', error_2);
13947
+ error_3 = _a.sent();
13948
+ logger.debug('The user is not authenticated by the error', error_3);
13783
13949
  return [2
13784
13950
  /*return*/
13785
13951
  , Promise.reject('The user is not authenticated')];
@@ -13811,7 +13977,7 @@ function () {
13811
13977
 
13812
13978
  AuthClass.prototype.fetchDevices = function () {
13813
13979
  return __awaiter(this, void 0, void 0, function () {
13814
- var currUser, error_3;
13980
+ var currUser, error_4;
13815
13981
  return __generator(this, function (_a) {
13816
13982
  switch (_a.label) {
13817
13983
  case 0:
@@ -13828,8 +13994,8 @@ function () {
13828
13994
  , 3];
13829
13995
 
13830
13996
  case 2:
13831
- error_3 = _a.sent();
13832
- logger.debug('The user is not authenticated by the error', error_3);
13997
+ error_4 = _a.sent();
13998
+ logger.debug('The user is not authenticated by the error', error_4);
13833
13999
  throw new Error('The user is not authenticated');
13834
14000
 
13835
14001
  case 3:
@@ -14026,6 +14192,9 @@ var authErrorMessages = {
14026
14192
  networkError: {
14027
14193
  message: _common_AuthErrorStrings__WEBPACK_IMPORTED_MODULE_1__["AuthErrorStrings"].NETWORK_ERROR
14028
14194
  },
14195
+ autoSignInError: {
14196
+ message: _common_AuthErrorStrings__WEBPACK_IMPORTED_MODULE_1__["AuthErrorStrings"].AUTOSIGNIN_ERROR
14197
+ },
14029
14198
  "default": {
14030
14199
  message: _common_AuthErrorStrings__WEBPACK_IMPORTED_MODULE_1__["AuthErrorStrings"].DEFAULT_MSG
14031
14200
  }
@@ -14753,6 +14922,7 @@ var AuthErrorStrings;
14753
14922
  AuthErrorStrings["NO_USER_SESSION"] = "Failed to get the session because the user is empty";
14754
14923
  AuthErrorStrings["NETWORK_ERROR"] = "Network Error";
14755
14924
  AuthErrorStrings["DEVICE_CONFIG"] = "Device tracking has not been configured in this User Pool";
14925
+ AuthErrorStrings["AUTOSIGNIN_ERROR"] = "Please use your credentials to sign in";
14756
14926
  })(AuthErrorStrings || (AuthErrorStrings = {}));
14757
14927
 
14758
14928
  /***/ }),
@@ -14886,6 +15056,7 @@ var AuthErrorTypes;
14886
15056
  AuthErrorTypes["Default"] = "default";
14887
15057
  AuthErrorTypes["DeviceConfig"] = "deviceConfig";
14888
15058
  AuthErrorTypes["NetworkError"] = "networkError";
15059
+ AuthErrorTypes["AutoSignInError"] = "autoSignInError";
14889
15060
  })(AuthErrorTypes || (AuthErrorTypes = {}));
14890
15061
 
14891
15062
  function isUsernamePasswordOpts(obj) {