@ollaid/native-sso 2.8.2 → 2.8.4

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.cjs CHANGED
@@ -7116,6 +7116,7 @@ let config = {
7116
7116
  iamApiUrl: "",
7117
7117
  timeout: 3e4,
7118
7118
  debug: false,
7119
+ bypass: false,
7119
7120
  configPrefix: "iam"
7120
7121
  };
7121
7122
  const memoryStorage = () => {
@@ -7786,12 +7787,15 @@ const nativeAuthService = {
7786
7787
  };
7787
7788
  credentialsLoadedAt = Date.now();
7788
7789
  credentialsTtl = response.credentials_ttl || DEFAULT_TTL;
7790
+ const currentConfig = getNativeAuthConfig();
7789
7791
  if (typeof response.debug === "boolean") {
7790
- const currentConfig = getNativeAuthConfig();
7791
7792
  if (currentConfig.debug !== true) {
7792
7793
  setNativeAuthConfig({ debug: response.debug });
7793
7794
  }
7794
7795
  }
7796
+ if (typeof response.bypass === "boolean") {
7797
+ setNativeAuthConfig({ bypass: response.bypass });
7798
+ }
7795
7799
  if (isDebugMode()) {
7796
7800
  console.log("✅ [SaaS] Credentials chargés (ttl:", credentialsTtl, "s, debug:", response.debug ?? "non défini", ")");
7797
7801
  }
@@ -7832,7 +7836,7 @@ const nativeAuthService = {
7832
7836
  `${config2.iamApiUrl}/iam/native/encrypt`,
7833
7837
  {
7834
7838
  method: "POST",
7835
- headers: getHeaders(),
7839
+ headers: getHeaders(void 0, true),
7836
7840
  body: JSON.stringify(payload)
7837
7841
  },
7838
7842
  config2.timeout || 3e4
@@ -7855,7 +7859,7 @@ const nativeAuthService = {
7855
7859
  `${config2.iamApiUrl}/iam/native/init`,
7856
7860
  {
7857
7861
  method: "POST",
7858
- headers: getHeaders(),
7862
+ headers: getHeaders(void 0, true),
7859
7863
  body: JSON.stringify({ native_token: nativeToken })
7860
7864
  },
7861
7865
  config2.timeout || 3e4
@@ -7878,7 +7882,7 @@ const nativeAuthService = {
7878
7882
  `${config2.iamApiUrl}/iam/native/validate`,
7879
7883
  {
7880
7884
  method: "POST",
7881
- headers: getHeaders(),
7885
+ headers: getHeaders(void 0, true),
7882
7886
  body: JSON.stringify({
7883
7887
  process_token: processToken,
7884
7888
  ...creds
@@ -7907,7 +7911,7 @@ const nativeAuthService = {
7907
7911
  `${config2.iamApiUrl}/iam/native/verify-totp`,
7908
7912
  {
7909
7913
  method: "POST",
7910
- headers: getHeaders(),
7914
+ headers: getHeaders(void 0, true),
7911
7915
  body: JSON.stringify({
7912
7916
  process_token: processToken,
7913
7917
  totp_code: totpCode
@@ -7929,7 +7933,7 @@ const nativeAuthService = {
7929
7933
  `${config2.iamApiUrl}/iam/native/grant-access`,
7930
7934
  {
7931
7935
  method: "POST",
7932
- headers: getHeaders(),
7936
+ headers: getHeaders(void 0, true),
7933
7937
  body: JSON.stringify({ process_token: processToken })
7934
7938
  },
7935
7939
  config2.timeout || 3e4
@@ -7948,7 +7952,7 @@ const nativeAuthService = {
7948
7952
  `${config2.iamApiUrl}/iam/native/resend-otp`,
7949
7953
  {
7950
7954
  method: "POST",
7951
- headers: getHeaders(),
7955
+ headers: getHeaders(void 0, true),
7952
7956
  body: JSON.stringify({ process_token: processToken })
7953
7957
  },
7954
7958
  config2.timeout || 3e4
@@ -8237,8 +8241,7 @@ function getIAMHeaders() {
8237
8241
  throw new ApiError("Credentials non chargés. Appelez loadCredentials() d'abord.", "auth");
8238
8242
  }
8239
8243
  return {
8240
- "Content-Type": "application/json",
8241
- "Accept": "application/json",
8244
+ ...getHeaders(void 0, true),
8242
8245
  "X-IAM-App-Key": creds.appKey
8243
8246
  };
8244
8247
  }
@@ -10970,7 +10973,7 @@ const mobileRegistrationService = {
10970
10973
  `${config2.iamApiUrl}/iam/native/validate`,
10971
10974
  {
10972
10975
  method: "POST",
10973
- headers: getHeaders(),
10976
+ headers: getHeaders(void 0, true),
10974
10977
  body: JSON.stringify({
10975
10978
  process_token: processToken,
10976
10979
  otp_code: otpCode
@@ -10992,7 +10995,7 @@ const mobileRegistrationService = {
10992
10995
  `${config2.iamApiUrl}/iam/native/validate`,
10993
10996
  {
10994
10997
  method: "POST",
10995
- headers: getHeaders(),
10998
+ headers: getHeaders(void 0, true),
10996
10999
  body: JSON.stringify({
10997
11000
  process_token: processToken,
10998
11001
  password,
@@ -11015,7 +11018,7 @@ const mobileRegistrationService = {
11015
11018
  `${config2.iamApiUrl}/iam/native/validate`,
11016
11019
  {
11017
11020
  method: "POST",
11018
- headers: getHeaders(),
11021
+ headers: getHeaders(void 0, true),
11019
11022
  body: JSON.stringify({
11020
11023
  process_token: processToken
11021
11024
  })