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