feat: init and fork some code from angular-auth-oidc-client
Some checks are pending
Build, Lint & Test Lib / Built, Lint and Test Library (push) Waiting to run
Build, Lint & Test Lib / Angular latest (push) Blocked by required conditions
Build, Lint & Test Lib / Angular latest & Schematics Job (push) Blocked by required conditions
Build, Lint & Test Lib / Angular latest Standalone & Schematics Job (push) Blocked by required conditions
Build, Lint & Test Lib / Angular 16 & RxJs 6 (push) Blocked by required conditions
Build, Lint & Test Lib / Angular V16 (push) Blocked by required conditions
Docs / Build and Deploy Docs Job (push) Waiting to run
Docs / Close Pull Request Job (push) Waiting to run
Some checks are pending
Build, Lint & Test Lib / Built, Lint and Test Library (push) Waiting to run
Build, Lint & Test Lib / Angular latest (push) Blocked by required conditions
Build, Lint & Test Lib / Angular latest & Schematics Job (push) Blocked by required conditions
Build, Lint & Test Lib / Angular latest Standalone & Schematics Job (push) Blocked by required conditions
Build, Lint & Test Lib / Angular 16 & RxJs 6 (push) Blocked by required conditions
Build, Lint & Test Lib / Angular V16 (push) Blocked by required conditions
Docs / Build and Deploy Docs Job (push) Waiting to run
Docs / Close Pull Request Job (push) Waiting to run
This commit is contained in:
25
src/auth-config.ts
Normal file
25
src/auth-config.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { InjectionToken, Provider } from 'injection-js';
|
||||
import {
|
||||
StsConfigLoader,
|
||||
StsConfigStaticLoader,
|
||||
} from './config/loader/config-loader';
|
||||
import { OpenIdConfiguration } from './config/openid-configuration';
|
||||
|
||||
export interface PassedInitialConfig {
|
||||
config?: OpenIdConfiguration | OpenIdConfiguration[];
|
||||
loader?: Provider;
|
||||
}
|
||||
|
||||
export function createStaticLoader(
|
||||
passedConfig: PassedInitialConfig
|
||||
): StsConfigLoader {
|
||||
if (!passedConfig?.config) {
|
||||
throw new Error('No config provided!');
|
||||
}
|
||||
|
||||
return new StsConfigStaticLoader(passedConfig.config);
|
||||
}
|
||||
|
||||
export const PASSED_CONFIG = new InjectionToken<PassedInitialConfig>(
|
||||
'PASSED_CONFIG'
|
||||
);
|
||||
Reference in New Issue
Block a user