@verdocs/js-sdk 4.2.90 → 4.2.91

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.mjs CHANGED
@@ -1319,15 +1319,15 @@ class VerdocsEndpoint {
1319
1319
  this.sessionType = sessionType;
1320
1320
  if (this.sessionType === 'user') {
1321
1321
  this.api.defaults.headers.common.Authorization = `Bearer ${token}`;
1322
+ if (this.persist) {
1323
+ localStorage.setItem(this.sessionStorageKey(), token);
1324
+ }
1322
1325
  }
1323
1326
  else {
1324
1327
  // Required for legacy calls to rForm
1325
1328
  this.api.defaults.headers.common.signer = `Bearer ${token}`;
1326
1329
  this.api.defaults.headers.common.Authorization = `Bearer ${token}`;
1327
1330
  }
1328
- if (this.persist && sessionType === 'user') {
1329
- localStorage.setItem(this.sessionStorageKey(), token);
1330
- }
1331
1331
  if (this.sessionType === 'user') {
1332
1332
  window?.console?.debug('[JS_SDK] Loading current profile...', this.endpointId, this.sub, session.sub);
1333
1333
  getCurrentProfile(this)
@@ -1678,7 +1678,7 @@ const startSigningSession = async (endpoint, envelope_id, role_name, key) => {
1678
1678
  return endpoint.api //
1679
1679
  .post(`/v2/sign/unauth/${envelope_id}/${encodeURIComponent(role_name)}/${key}`)
1680
1680
  .then((r) => {
1681
- endpoint.setToken(r.data.access_token);
1681
+ endpoint.setToken(r.data.access_token, 'signing');
1682
1682
  return r.data;
1683
1683
  });
1684
1684
  };