20 lines
949 B
TypeScript
20 lines
949 B
TypeScript
|
export const Config = {
|
||
|
// The OpenID Connect client_id
|
||
|
oauth2ClientId: get<string>("oauth2ClientId", "daddy"),
|
||
|
oauth2Scope: get<string>("oauth2Scope", "email email_verified openid offline_access"),
|
||
|
oauth2RedirectURI: get<string>("oauth2RedirectURI", "http://localhost:8081/oauth2/callback"),
|
||
|
oauth2Audience: get<string>("oauth2Audience", ""),
|
||
|
oauth2AuthorizeURL: get<string>("oauth2AuthorizeURL", "http://localhost:4444/oauth2/auth"),
|
||
|
oauth2TokenURL: get<string>("oauth2TokenURL", "http://localhost:4444/oauth2/token"),
|
||
|
oauth2LogoutURL: get<string>("oauth2LogoutURL", "http://localhost:4444/oauth2/sessions/logout"),
|
||
|
oauth2PostLogoutRedirectURI: get<string>("oauth2PostLogoutRedirectURI", "http://localhost:8081")
|
||
|
};
|
||
|
|
||
|
function get<T>(key: string, defaultValue: T):T {
|
||
|
const config = window['__CONFIG__'] || {};
|
||
|
if (config && config.hasOwnProperty(key)) {
|
||
|
return config[key] as T;
|
||
|
} else {
|
||
|
return defaultValue;
|
||
|
}
|
||
|
}
|