Skip to content

Commit

Permalink
Merge pull request #20813 from abpframework/ng/env-impersonation
Browse files Browse the repository at this point in the history
Add impersonation option to oAuthConfig in environment model
  • Loading branch information
sumeyyeKurtulus authored Sep 19, 2024
2 parents 04b7169 + 4698af9 commit f129844
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 6 additions & 1 deletion npm/ng-packs/packages/core/src/lib/models/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -38,3 +38,8 @@ export interface RemoteEnv {
method?: string;
headers?: ABP.Dictionary<string>;
}

export interface Impersonation {
tenantImpersonation?: boolean;
userImpersonation?: boolean;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 || {});
}
}

0 comments on commit f129844

Please sign in to comment.