Browse Source

Merge pull request #20813 from abpframework/ng/env-impersonation

Add impersonation option to oAuthConfig in environment model
pull/20843/head
sumeyye 2 years ago
committed by GitHub
parent
commit
f129844581
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 7
      npm/ng-packs/packages/core/src/lib/models/environment.ts
  2. 8
      npm/ng-packs/packages/core/src/lib/services/environment.service.ts

7
npm/ng-packs/packages/core/src/lib/models/environment.ts

@ -7,7 +7,7 @@ export interface Environment {
hmr?: boolean;
test?: boolean;
localization?: { defaultResourceName?: string };
oAuthConfig?: AuthConfig;
oAuthConfig?: AuthConfig & { impersonation?: Impersonation };
production: boolean;
remoteEnv?: RemoteEnv;
[key: string]: any; // eslint-disable-line @typescript-eslint/no-explicit-any
@ -38,3 +38,8 @@ export interface RemoteEnv {
method?: string;
headers?: ABP.Dictionary<string>;
}
export interface Impersonation {
tenantImpersonation?: boolean;
userImpersonation?: boolean;
}

8
npm/ng-packs/packages/core/src/lib/services/environment.service.ts

@ -51,4 +51,12 @@ export class EnvironmentService {
getIssuer$() {
return this.store.sliceState(state => state?.oAuthConfig?.issuer).pipe(map(mapToIssuer));
}
getImpersonation() {
return this.store.state?.oAuthConfig?.impersonation || {};
}
getImpersonation$() {
return this.store.sliceState(state => state?.oAuthConfig?.impersonation || {});
}
}

Loading…
Cancel
Save