contentoh-components-library 21.4.34 → 21.4.35

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.
@@ -40,8 +40,6 @@ var _axios = _interopRequireDefault(require("axios"));
40
40
  var _jsxRuntime = require("react/jsx-runtime");
41
41
 
42
42
  var SignInLogin = function SignInLogin(props) {
43
- if (props.showProps) console.log(props);
44
-
45
43
  var _useState = (0, _react.useState)(false),
46
44
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
47
45
  emptyEmail = _useState2[0],
@@ -107,7 +105,7 @@ var SignInLogin = function SignInLogin(props) {
107
105
  }
108
106
 
109
107
  if (!valid) {
110
- _context.next = 46;
108
+ _context.next = 47;
111
109
  break;
112
110
  }
113
111
 
@@ -118,35 +116,36 @@ var SignInLogin = function SignInLogin(props) {
118
116
 
119
117
  case 14:
120
118
  session = _context.sent;
119
+ console.log(session);
121
120
 
122
121
  if (!(session.challengeName === "NEW_PASSWORD_REQUIRED")) {
123
- _context.next = 20;
122
+ _context.next = 21;
124
123
  break;
125
124
  }
126
125
 
127
126
  props.setUser(session);
128
127
  props.setPaso(8);
129
- _context.next = 39;
128
+ _context.next = 40;
130
129
  break;
131
130
 
132
- case 20:
131
+ case 21:
133
132
  userGroup = session.signInUserSession.accessToken.payload["cognito:groups"];
134
133
 
135
134
  if (!userGroup.inclues(props.users)) {
136
- _context.next = 37;
135
+ _context.next = 38;
137
136
  break;
138
137
  }
139
138
 
140
139
  sessionStorage.setItem("auth", true);
141
140
  sessionStorage.setItem("jwt", session.signInUserSession.idToken.jwtToken);
142
- _context.next = 26;
141
+ _context.next = 27;
143
142
  return _axios.default.get(process.env.REACT_APP_USER_ENDPOINT, {
144
143
  headers: {
145
144
  Authorization: session.signInUserSession.idToken.jwtToken
146
145
  }
147
146
  });
148
147
 
149
- case 26:
148
+ case 27:
150
149
  response = _context.sent;
151
150
  user = JSON.parse(response.data.body).data[0];
152
151
  company = JSON.parse(response.data.body).data[1];
@@ -165,19 +164,19 @@ var SignInLogin = function SignInLogin(props) {
165
164
  sessionStorage.setItem("user", JSON.stringify(user));
166
165
  sessionStorage.setItem("company", JSON.stringify(company));
167
166
  setUpgradePlanRedirect(true);
168
- _context.next = 39;
167
+ _context.next = 40;
169
168
  break;
170
169
 
171
- case 37:
170
+ case 38:
172
171
  setSignInError("NotAuthorizedException");
173
172
  setLoading(false);
174
173
 
175
- case 39:
176
- _context.next = 46;
174
+ case 40:
175
+ _context.next = 47;
177
176
  break;
178
177
 
179
- case 41:
180
- _context.prev = 41;
178
+ case 42:
179
+ _context.prev = 42;
181
180
  _context.t0 = _context["catch"](10);
182
181
  console.log(_context.t0);
183
182
  setLoading(false);
@@ -191,12 +190,12 @@ var SignInLogin = function SignInLogin(props) {
191
190
  setSignInError("Error");
192
191
  }
193
192
 
194
- case 46:
193
+ case 47:
195
194
  case "end":
196
195
  return _context.stop();
197
196
  }
198
197
  }
199
- }, _callee, null, [[10, 41]]);
198
+ }, _callee, null, [[10, 42]]);
200
199
  }));
201
200
 
202
201
  return function validate(_x) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.4.34",
3
+ "version": "21.4.35",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -12,7 +12,6 @@ import showPassword from "../../../assets/images/editField/showPassword.png";
12
12
  import axios from "axios";
13
13
 
14
14
  export const SignInLogin = (props) => {
15
- if (props.showProps) console.log(props);
16
15
  const [emptyEmail, setEmptyEmail] = useState(false);
17
16
  const [invalidEmail, setInvalidEmail] = useState(false);
18
17
  const [emptyPassword, setEmptyPassword] = useState(false);
@@ -49,6 +48,7 @@ export const SignInLogin = (props) => {
49
48
  try {
50
49
  setLoading(true);
51
50
  const session = await props.Auth.signIn(email, password);
51
+ console.log(session);
52
52
  if (session.challengeName === "NEW_PASSWORD_REQUIRED") {
53
53
  props.setUser(session);
54
54
  props.setPaso(8);