mirror of
https://github.com/logto-io/logto.git
synced 2025-01-13 21:30:30 -05:00
feat(schemas): add suppport email and website url to sie (#6789)
* feat(schemas): add suppport email and website url to sie add support email and website url to sie * fix(experience): fix type issue fix type issue * fix(core): fix ut fix ut
This commit is contained in:
parent
f4a374f7ac
commit
1cee704939
6 changed files with 35 additions and 1 deletions
|
@ -100,4 +100,6 @@ export const mockSignInExperience: SignInExperience = {
|
||||||
},
|
},
|
||||||
singleSignOnEnabled: true,
|
singleSignOnEnabled: true,
|
||||||
socialSignIn: {},
|
socialSignIn: {},
|
||||||
|
supportEmail: null,
|
||||||
|
supportWebsiteUrl: null,
|
||||||
};
|
};
|
||||||
|
|
|
@ -41,7 +41,7 @@ describe('sign-in-experience query', () => {
|
||||||
it('findDefaultSignInExperience', async () => {
|
it('findDefaultSignInExperience', async () => {
|
||||||
/* eslint-disable sql/no-unsafe-query */
|
/* eslint-disable sql/no-unsafe-query */
|
||||||
const expectSql = `
|
const expectSql = `
|
||||||
select "tenant_id", "id", "color", "branding", "language_info", "terms_of_use_url", "privacy_policy_url", "agree_to_terms_policy", "sign_in", "sign_up", "social_sign_in", "social_sign_in_connector_targets", "sign_in_mode", "custom_css", "custom_content", "custom_ui_assets", "password_policy", "mfa", "single_sign_on_enabled"
|
select "tenant_id", "id", "color", "branding", "language_info", "terms_of_use_url", "privacy_policy_url", "agree_to_terms_policy", "sign_in", "sign_up", "social_sign_in", "social_sign_in_connector_targets", "sign_in_mode", "custom_css", "custom_content", "custom_ui_assets", "password_policy", "mfa", "single_sign_on_enabled", "support_email", "support_website_url"
|
||||||
from "sign_in_experiences"
|
from "sign_in_experiences"
|
||||||
where "id"=$1
|
where "id"=$1
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -114,6 +114,8 @@ export const mockSignInExperience: SignInExperience = {
|
||||||
},
|
},
|
||||||
singleSignOnEnabled: true,
|
singleSignOnEnabled: true,
|
||||||
socialSignIn: {},
|
socialSignIn: {},
|
||||||
|
supportEmail: null,
|
||||||
|
supportWebsiteUrl: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const mockSignInExperienceSettings: SignInExperienceResponse = {
|
export const mockSignInExperienceSettings: SignInExperienceResponse = {
|
||||||
|
@ -149,6 +151,8 @@ export const mockSignInExperienceSettings: SignInExperienceResponse = {
|
||||||
isDevelopmentTenant: false,
|
isDevelopmentTenant: false,
|
||||||
singleSignOnEnabled: true,
|
singleSignOnEnabled: true,
|
||||||
socialSignIn: {},
|
socialSignIn: {},
|
||||||
|
supportEmail: null,
|
||||||
|
supportWebsiteUrl: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
const usernameSettings = {
|
const usernameSettings = {
|
||||||
|
|
|
@ -114,6 +114,8 @@ export const mockSignInExperience: SignInExperience = {
|
||||||
},
|
},
|
||||||
singleSignOnEnabled: true,
|
singleSignOnEnabled: true,
|
||||||
socialSignIn: {},
|
socialSignIn: {},
|
||||||
|
supportEmail: null,
|
||||||
|
supportWebsiteUrl: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const mockSignInExperienceSettings: SignInExperienceResponse = {
|
export const mockSignInExperienceSettings: SignInExperienceResponse = {
|
||||||
|
@ -149,6 +151,8 @@ export const mockSignInExperienceSettings: SignInExperienceResponse = {
|
||||||
isDevelopmentTenant: false,
|
isDevelopmentTenant: false,
|
||||||
singleSignOnEnabled: true,
|
singleSignOnEnabled: true,
|
||||||
socialSignIn: {},
|
socialSignIn: {},
|
||||||
|
supportEmail: null,
|
||||||
|
supportWebsiteUrl: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
const usernameSettings = {
|
const usernameSettings = {
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
import { sql } from '@silverhand/slonik';
|
||||||
|
|
||||||
|
import type { AlterationScript } from '../lib/types/alteration.js';
|
||||||
|
|
||||||
|
const alteration: AlterationScript = {
|
||||||
|
up: async (pool) => {
|
||||||
|
await pool.query(sql`
|
||||||
|
alter table sign_in_experiences
|
||||||
|
add column support_email text,
|
||||||
|
add column support_website_url text;
|
||||||
|
`);
|
||||||
|
},
|
||||||
|
down: async (pool) => {
|
||||||
|
await pool.query(sql`
|
||||||
|
alter table sign_in_experiences
|
||||||
|
drop column support_email,
|
||||||
|
drop column support_website_url;
|
||||||
|
`);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default alteration;
|
|
@ -23,5 +23,7 @@ create table sign_in_experiences (
|
||||||
password_policy jsonb /* @use PartialPasswordPolicy */ not null default '{}'::jsonb,
|
password_policy jsonb /* @use PartialPasswordPolicy */ not null default '{}'::jsonb,
|
||||||
mfa jsonb /* @use Mfa */ not null default '{}'::jsonb,
|
mfa jsonb /* @use Mfa */ not null default '{}'::jsonb,
|
||||||
single_sign_on_enabled boolean not null default false,
|
single_sign_on_enabled boolean not null default false,
|
||||||
|
support_email text,
|
||||||
|
support_website_url text,
|
||||||
primary key (tenant_id, id)
|
primary key (tenant_id, id)
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Reference in a new issue