@acuteinfo/common-screens 1.0.34 → 1.0.36

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 CHANGED
@@ -459,9 +459,7 @@ const OTPModel = ({ classes, OTPResendRequest, open, handleClose, loginState, Ve
459
459
  // fullWidth
460
460
  disabled: loginState.otploading, onClick: () => {
461
461
  previousStep(false, "");
462
- }, className: classes.otpButtons,
463
- // color={"var(--theme-color3) "}
464
- sx: {
462
+ }, className: classes.otpButtons, textColor: "var(--theme-color3)", sx: {
465
463
  border: "var(--theme-color3)1px solid",
466
464
  minWidth: "50%",
467
465
  background: "var(--theme-color2)",
@@ -570,10 +568,10 @@ const OTPModelForm = ({ classes, OTPResendRequest, handleClose, loginState, Veri
570
568
  gap: "10px",
571
569
  margin: "42px 0 0 42px",
572
570
  width: "60%",
573
- }, children: [jsx(GradientButton, { fullWidth: true, disabled: loginState.otploading, onClick: handleCloseEvent, className: classes.otpButtons, starticon: "West", textColor: "var(--theme-color1) !important", sx: {
571
+ }, children: [jsx(GradientButton, { fullWidth: true, disabled: loginState.otploading, onClick: handleCloseEvent, className: classes.otpButtons, starticon: "West", textColor: "var(--theme-color3) !important", sx: {
574
572
  "&:disabled": {
575
- color: "var(-theme-color1) !important"
576
- }
573
+ color: "var(-theme-color3) !important",
574
+ },
577
575
  }, rotateIcon: "scale(1.4) rotateX(360deg)", style: {
578
576
  border: "var(--theme-color3)1px solid",
579
577
  // color: "var(--theme-color2)",
@@ -1243,42 +1241,47 @@ const AuthControllerWrapper = ({ bannerDetails, logoUrl, logoTitle, loginFn, vei
1243
1241
  const verifyUsernamePassword = async (username, password) => {
1244
1242
  if (Boolean(username) && Boolean(password)) {
1245
1243
  dispath({ type: "inititatePasswordVerification" });
1246
- const { status, data, message, responseType, access_token } = await veirfyUsernameandPassword(username, password);
1247
- if (status === "0" && responseType === "S") {
1248
- dispath({
1249
- type: "passwordRotation",
1250
- payload: {
1251
- username: username,
1252
- access_token: access_token?.access_token,
1253
- token_type: access_token?.token_type,
1254
- },
1255
- });
1256
- setOpenPwdReset(true);
1257
- }
1258
- else if (status === "0") {
1259
- dispath({
1260
- type: "passwordVerificationSuccessful",
1261
- payload: {
1262
- transactionID: data?.REQUEST_CD,
1263
- username: username,
1264
- access_token: access_token?.access_token,
1265
- token_type: access_token?.token_type,
1266
- authType: data?.AUTH_TYPE,
1267
- auth_data: [
1268
- {
1269
- company_ID: data?.BASE_COMP_CD ?? "",
1270
- branch_cd: data?.BASE_BRANCH_CD,
1271
- },
1272
- ],
1273
- otpValidFor: data?.OTP_VALID,
1274
- },
1275
- });
1244
+ try {
1245
+ const { status = "", data = null, message = "", responseType = "", access_token = null } = await veirfyUsernameandPassword(username, password);
1246
+ if (status === "0" && responseType === "S") {
1247
+ dispath({
1248
+ type: "passwordRotation",
1249
+ payload: {
1250
+ username: username,
1251
+ access_token: access_token?.access_token || "",
1252
+ token_type: access_token?.token_type || "",
1253
+ },
1254
+ });
1255
+ setOpenPwdReset(true);
1256
+ }
1257
+ else if (status === "0") {
1258
+ dispath({
1259
+ type: "passwordVerificationSuccessful",
1260
+ payload: {
1261
+ transactionID: data?.REQUEST_CD,
1262
+ username: username,
1263
+ access_token: access_token?.access_token,
1264
+ token_type: access_token?.token_type,
1265
+ authType: data?.AUTH_TYPE,
1266
+ auth_data: [
1267
+ {
1268
+ company_ID: data?.BASE_COMP_CD ?? "",
1269
+ branch_cd: data?.BASE_BRANCH_CD,
1270
+ },
1271
+ ],
1272
+ otpValidFor: data?.OTP_VALID,
1273
+ },
1274
+ });
1275
+ }
1276
+ else {
1277
+ dispath({
1278
+ type: "passwordVerificationFailure",
1279
+ payload: { error: message, errorPassword: message },
1280
+ });
1281
+ }
1276
1282
  }
1277
- else {
1278
- dispath({
1279
- type: "passwordVerificationFailure",
1280
- payload: { error: message, errorPassword: message },
1281
- });
1283
+ catch (err) {
1284
+ console.log("Error occurred while verifying username and password!", err);
1282
1285
  }
1283
1286
  }
1284
1287
  else if (!Boolean(username) && !Boolean(password)) {