0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -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:
simeng-li 2024-11-12 09:51:34 +08:00 committed by GitHub
parent f4a374f7ac
commit 1cee704939
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 35 additions and 1 deletions

View file

@ -100,4 +100,6 @@ export const mockSignInExperience: SignInExperience = {
},
singleSignOnEnabled: true,
socialSignIn: {},
supportEmail: null,
supportWebsiteUrl: null,
};

View file

@ -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
`;

View file

@ -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 = {

View file

@ -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 = {

View file

@ -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;

View file

@ -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)
);