Skip to content

Commit 4f42b4e

Browse files
add suggestions
1 parent edbdc97 commit 4f42b4e

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

src/context/AuthProviderOnboarding.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function AuthProviderOnboarding({
1818
return <AuthProvider {...authConfig}>{children}</AuthProvider>;
1919
}
2020

21-
export function buildAuthProviderConfig(oidcConfig: OIDCConfig) {
21+
function buildAuthProviderConfig(oidcConfig: OIDCConfig) {
2222
const userStore = new WebStorageStateStore({ store: window.localStorage });
2323

2424
const props: AuthProviderProps = {

src/context/FrontendConfigContext.tsx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,7 @@ export enum Landscape {
1010
Local = 'LOCAL',
1111
}
1212

13-
export interface OIDCConfig {
14-
clientId: string;
15-
issuerUrl: string;
16-
scopes: string[];
17-
}
1813

19-
type FrontendConfig = {
20-
backendUrl: string;
21-
gatewayUrl: string;
22-
landscape?: Landscape;
23-
documentationBaseUrl: string;
24-
oidcConfig: OIDCConfig;
25-
}
2614

2715
interface FrontendConfigContextType extends FrontendConfig {
2816
links: DocLinkCreator;
@@ -67,6 +55,7 @@ const OidcConfigSchema = z.object({
6755
issuerUrl: z.string(),
6856
scopes: z.array(z.string()),
6957
});
58+
export type OIDCConfig = z.infer<typeof OidcConfigSchema>;
7059

7160
const FrontendConfigSchema = z.object({
7261
backendUrl: z.string(),
@@ -75,6 +64,7 @@ const FrontendConfigSchema = z.object({
7564
oidcConfig: OidcConfigSchema,
7665
landscape: z.optional(z.nativeEnum(Landscape)),
7766
});
67+
type FrontendConfig = z.infer<typeof FrontendConfigSchema>;
7868

7969
function validateAndCastFrontendConfig(config: unknown): FrontendConfig {
8070
try {

0 commit comments

Comments
 (0)