mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-17 13:27:34 +00:00
693e27b906
# Which Problems Are Solved The default terms of service and privacy policy links are applied to all new ZITADEL instances, also for self hosters. However, the links contents don't apply to self-hosters. # How the Problems Are Solved The links are removed from the DefaultInstance section in the *defaults.yaml* file. By default, the links are not shown anymore in the hosted login pages. They can still be configured using the privacy policy. # Additional Context - Found because of a support request
32 lines
855 B
TypeScript
32 lines
855 B
TypeScript
import { ensureSetting } from './ensure';
|
|
import { API } from './types';
|
|
|
|
export function ensureExternalLinksSettingsSet(api: API, tosLink: string, privacyPolicyLink: string, docsLink: string) {
|
|
return ensureSetting(
|
|
api,
|
|
`${api.adminBaseURL}/policies/privacy`,
|
|
(body: any) => {
|
|
const result = {
|
|
sequence: body.policy?.details?.sequence,
|
|
id: body.policy.id,
|
|
entity: null,
|
|
};
|
|
if (
|
|
body.policy &&
|
|
(body.policy.tosLink || '') === tosLink &&
|
|
(body.policy.privacyLink || '') === privacyPolicyLink &&
|
|
(body.policy.docsLink || '') === docsLink
|
|
) {
|
|
return { ...result, entity: body.policy };
|
|
}
|
|
return result;
|
|
},
|
|
`${api.adminBaseURL}/policies/privacy`,
|
|
{
|
|
tosLink,
|
|
privacyLink: privacyPolicyLink,
|
|
docsLink,
|
|
},
|
|
);
|
|
}
|