diff --git a/packages/core/src/__mocks__/sign-in-experience.ts b/packages/core/src/__mocks__/sign-in-experience.ts index f76cf869f..02d5eb88e 100644 --- a/packages/core/src/__mocks__/sign-in-experience.ts +++ b/packages/core/src/__mocks__/sign-in-experience.ts @@ -100,4 +100,6 @@ export const mockSignInExperience: SignInExperience = { }, singleSignOnEnabled: true, socialSignIn: {}, + supportEmail: null, + supportWebsiteUrl: null, }; diff --git a/packages/core/src/queries/sign-in-experience.test.ts b/packages/core/src/queries/sign-in-experience.test.ts index 7bfca4aed..be4631956 100644 --- a/packages/core/src/queries/sign-in-experience.test.ts +++ b/packages/core/src/queries/sign-in-experience.test.ts @@ -41,7 +41,7 @@ describe('sign-in-experience query', () => { it('findDefaultSignInExperience', async () => { /* eslint-disable sql/no-unsafe-query */ 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" where "id"=$1 `; diff --git a/packages/experience-legacy/src/__mocks__/logto.tsx b/packages/experience-legacy/src/__mocks__/logto.tsx index d7138716e..03e13c53e 100644 --- a/packages/experience-legacy/src/__mocks__/logto.tsx +++ b/packages/experience-legacy/src/__mocks__/logto.tsx @@ -114,6 +114,8 @@ export const mockSignInExperience: SignInExperience = { }, singleSignOnEnabled: true, socialSignIn: {}, + supportEmail: null, + supportWebsiteUrl: null, }; export const mockSignInExperienceSettings: SignInExperienceResponse = { @@ -149,6 +151,8 @@ export const mockSignInExperienceSettings: SignInExperienceResponse = { isDevelopmentTenant: false, singleSignOnEnabled: true, socialSignIn: {}, + supportEmail: null, + supportWebsiteUrl: null, }; const usernameSettings = { diff --git a/packages/experience/src/__mocks__/logto.tsx b/packages/experience/src/__mocks__/logto.tsx index d7138716e..03e13c53e 100644 --- a/packages/experience/src/__mocks__/logto.tsx +++ b/packages/experience/src/__mocks__/logto.tsx @@ -114,6 +114,8 @@ export const mockSignInExperience: SignInExperience = { }, singleSignOnEnabled: true, socialSignIn: {}, + supportEmail: null, + supportWebsiteUrl: null, }; export const mockSignInExperienceSettings: SignInExperienceResponse = { @@ -149,6 +151,8 @@ export const mockSignInExperienceSettings: SignInExperienceResponse = { isDevelopmentTenant: false, singleSignOnEnabled: true, socialSignIn: {}, + supportEmail: null, + supportWebsiteUrl: null, }; const usernameSettings = { diff --git a/packages/schemas/alterations/next-1731304920-add-support-email-and-website-to-sie-table.ts b/packages/schemas/alterations/next-1731304920-add-support-email-and-website-to-sie-table.ts new file mode 100644 index 000000000..017bbece3 --- /dev/null +++ b/packages/schemas/alterations/next-1731304920-add-support-email-and-website-to-sie-table.ts @@ -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; diff --git a/packages/schemas/tables/sign_in_experiences.sql b/packages/schemas/tables/sign_in_experiences.sql index 8e34aafd4..28be3dc81 100644 --- a/packages/schemas/tables/sign_in_experiences.sql +++ b/packages/schemas/tables/sign_in_experiences.sql @@ -23,5 +23,7 @@ create table sign_in_experiences ( password_policy jsonb /* @use PartialPasswordPolicy */ not null default '{}'::jsonb, mfa jsonb /* @use Mfa */ not null default '{}'::jsonb, single_sign_on_enabled boolean not null default false, + support_email text, + support_website_url text, primary key (tenant_id, id) );