@trudb/tru-common-lib 0.0.708 → 0.0.710

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.
@@ -363,6 +363,7 @@ class TruAppEnvironment {
363
363
  return 'Are you sure you want to delete ' + count + ' ' + tablePluralLabel + '?';
364
364
  };
365
365
  this._appUri = '';
366
+ this._authType = 'jwt';
366
367
  this._maxRecordCount = 0;
367
368
  this.msgModifierKeyLabel = this.isMac ? 'Cmd' : 'Ctrl';
368
369
  this.msgConfirmExitWithChangesPending = 'You have unsaved changes that will be lost.';
@@ -386,6 +387,12 @@ class TruAppEnvironment {
386
387
  set appUri(uri) {
387
388
  this._appUri = uri;
388
389
  }
390
+ get authType() {
391
+ return this._authType;
392
+ }
393
+ set authType(type) {
394
+ this._authType = type;
395
+ }
389
396
  get isSaving() {
390
397
  return this._isSaving.getValue();
391
398
  }
@@ -6074,11 +6081,11 @@ class TruAuthSessionStrategy {
6074
6081
  const TruAuthStrategyProvider = {
6075
6082
  provide: TRU_AUTH_STRATEGY,
6076
6083
  deps: [HttpClient],
6077
- useFactory: (http) => {
6078
- switch (TRU_AUTH_CONFIG.auth) {
6084
+ useFactory: (http, appEnvironment) => {
6085
+ switch (appEnvironment.authType) {
6079
6086
  case "session":
6080
6087
  return new TruAuthSessionStrategy(http);
6081
- case "token":
6088
+ case "jwt":
6082
6089
  return new TruAuthJwtStrategy();
6083
6090
  default:
6084
6091
  throw new Error("Invalid auth strategy");