@acuteinfo/common-screens 1.0.39 → 1.0.41
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 +42 -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
|
@@ -1244,48 +1244,49 @@ const AuthControllerWrapper = ({ bannerDetails, logoUrl, logoTitle, loginFn, vei
|
|
|
1244
1244
|
const verifyUsernamePassword = async (username, password) => {
|
|
1245
1245
|
if (Boolean(username) && Boolean(password)) {
|
|
1246
1246
|
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
|
-
}
|
|
1247
|
+
// try {
|
|
1248
|
+
const { status, data, message, responseType, access_token, } = await veirfyUsernameandPassword(username, password);
|
|
1249
|
+
if (status === "0" && responseType === "S") {
|
|
1250
|
+
dispath({
|
|
1251
|
+
type: "passwordRotation",
|
|
1252
|
+
payload: {
|
|
1253
|
+
username: username,
|
|
1254
|
+
access_token: access_token?.access_token || "",
|
|
1255
|
+
token_type: access_token?.token_type || "",
|
|
1256
|
+
},
|
|
1257
|
+
});
|
|
1258
|
+
setOpenPwdReset(true);
|
|
1285
1259
|
}
|
|
1286
|
-
|
|
1287
|
-
|
|
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
|
+
});
|
|
1288
1284
|
}
|
|
1285
|
+
// } catch (err) {
|
|
1286
|
+
// throw new Error(
|
|
1287
|
+
// "Error occurred while verifying username and password: " + err,
|
|
1288
|
+
// );
|
|
1289
|
+
// }
|
|
1289
1290
|
}
|
|
1290
1291
|
else if (!Boolean(username) && !Boolean(password)) {
|
|
1291
1292
|
dispath({
|
|
@@ -1319,6 +1320,7 @@ const AuthControllerWrapper = ({ bannerDetails, logoUrl, logoTitle, loginFn, vei
|
|
|
1319
1320
|
const VerifyOTP = async (OTPNumber) => {
|
|
1320
1321
|
if (Boolean(OTPNumber) && OTPNumber.toString().length === 6) {
|
|
1321
1322
|
dispath({ type: "inititateOTPVerification" });
|
|
1323
|
+
console.log("loginstate1<<", loginState);
|
|
1322
1324
|
const { status, data, message } = await verifyOTP(loginState.transactionID,
|
|
1323
1325
|
// loginState.app_transactionId,
|
|
1324
1326
|
loginState.username, OTPNumber, loginState.access_token, loginState.token_type, loginState.authType);
|