@acuteinfo/common-screens 1.0.39 → 1.0.42
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/dist/index.js +43 -40
- package/dist/index.js.map +1 -1
- package/dist/pages/auth/authController.d.ts +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1220,6 +1220,7 @@ const reducer$1 = (state, action) => {
|
|
|
1220
1220
|
const AuthControllerWrapper = ({ bannerDetails, logoUrl, logoTitle, loginFn, veirfyUsernameandPassword, verifyOTP, OTPResendRequest, ResetPassword, LanguageComponent, forgotPasswordEndpoint, }) => {
|
|
1221
1221
|
const classes = useStyles$3();
|
|
1222
1222
|
const [loginState, dispath] = useReducer(reducer$1, inititalState$1);
|
|
1223
|
+
console.log("loginState<<", loginState);
|
|
1223
1224
|
const [openpwdreset, setOpenPwdReset] = useState(false);
|
|
1224
1225
|
const failureCount = useRef(0);
|
|
1225
1226
|
const [dashboardLogoURL, setDashboardLogoURL] = useState(null);
|
|
@@ -1244,48 +1245,50 @@ const AuthControllerWrapper = ({ bannerDetails, logoUrl, logoTitle, loginFn, vei
|
|
|
1244
1245
|
const verifyUsernamePassword = async (username, password) => {
|
|
1245
1246
|
if (Boolean(username) && Boolean(password)) {
|
|
1246
1247
|
dispath({ type: "inititatePasswordVerification" });
|
|
1247
|
-
try {
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
}
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
else if (status === "0") {
|
|
1261
|
-
dispath({
|
|
1262
|
-
type: "passwordVerificationSuccessful",
|
|
1263
|
-
payload: {
|
|
1264
|
-
transactionID: data?.REQUEST_CD,
|
|
1265
|
-
username: username,
|
|
1266
|
-
access_token: access_token?.access_token,
|
|
1267
|
-
token_type: access_token?.token_type,
|
|
1268
|
-
authType: data?.AUTH_TYPE,
|
|
1269
|
-
auth_data: [
|
|
1270
|
-
{
|
|
1271
|
-
company_ID: data?.BASE_COMP_CD ?? "",
|
|
1272
|
-
branch_cd: data?.BASE_BRANCH_CD,
|
|
1273
|
-
},
|
|
1274
|
-
],
|
|
1275
|
-
otpValidFor: data?.OTP_VALID,
|
|
1276
|
-
},
|
|
1277
|
-
});
|
|
1278
|
-
}
|
|
1279
|
-
else {
|
|
1280
|
-
dispath({
|
|
1281
|
-
type: "passwordVerificationFailure",
|
|
1282
|
-
payload: { error: message, errorPassword: message },
|
|
1283
|
-
});
|
|
1284
|
-
}
|
|
1248
|
+
// try {
|
|
1249
|
+
const { status, data, message, responseType, access_token, } = await veirfyUsernameandPassword(username, password);
|
|
1250
|
+
console.log("status", status, "data", data, "message", message, "response", responseType, "access_token", access_token);
|
|
1251
|
+
if (status === "0" && responseType === "S") {
|
|
1252
|
+
dispath({
|
|
1253
|
+
type: "passwordRotation",
|
|
1254
|
+
payload: {
|
|
1255
|
+
username: username,
|
|
1256
|
+
access_token: access_token?.access_token || "",
|
|
1257
|
+
token_type: access_token?.token_type || "",
|
|
1258
|
+
},
|
|
1259
|
+
});
|
|
1260
|
+
setOpenPwdReset(true);
|
|
1285
1261
|
}
|
|
1286
|
-
|
|
1287
|
-
|
|
1262
|
+
else if (status === "0") {
|
|
1263
|
+
dispath({
|
|
1264
|
+
type: "passwordVerificationSuccessful",
|
|
1265
|
+
payload: {
|
|
1266
|
+
transactionID: data?.REQUEST_CD,
|
|
1267
|
+
username: username,
|
|
1268
|
+
access_token: access_token?.access_token,
|
|
1269
|
+
token_type: access_token?.token_type,
|
|
1270
|
+
authType: data?.AUTH_TYPE,
|
|
1271
|
+
auth_data: [
|
|
1272
|
+
{
|
|
1273
|
+
company_ID: data?.BASE_COMP_CD ?? "",
|
|
1274
|
+
branch_cd: data?.BASE_BRANCH_CD,
|
|
1275
|
+
},
|
|
1276
|
+
],
|
|
1277
|
+
otpValidFor: data?.OTP_VALID,
|
|
1278
|
+
},
|
|
1279
|
+
});
|
|
1280
|
+
}
|
|
1281
|
+
else {
|
|
1282
|
+
dispath({
|
|
1283
|
+
type: "passwordVerificationFailure",
|
|
1284
|
+
payload: { error: message, errorPassword: message },
|
|
1285
|
+
});
|
|
1288
1286
|
}
|
|
1287
|
+
// } catch (err) {
|
|
1288
|
+
// throw new Error(
|
|
1289
|
+
// "Error occurred while verifying username and password: " + err,
|
|
1290
|
+
// );
|
|
1291
|
+
// }
|
|
1289
1292
|
}
|
|
1290
1293
|
else if (!Boolean(username) && !Boolean(password)) {
|
|
1291
1294
|
dispath({
|