Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(schemas): add suppport email and website url to sie #6789

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/core/src/__mocks__/sign-in-experience.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,6 @@ export const mockSignInExperience: SignInExperience = {
},
singleSignOnEnabled: true,
socialSignIn: {},
supportEmail: null,
supportWebsiteUrl: null,
};
2 changes: 1 addition & 1 deletion packages/core/src/queries/sign-in-experience.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
`;
Expand Down
4 changes: 4 additions & 0 deletions packages/experience-legacy/src/__mocks__/logto.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ export const mockSignInExperience: SignInExperience = {
},
singleSignOnEnabled: true,
socialSignIn: {},
supportEmail: null,
supportWebsiteUrl: null,
};

export const mockSignInExperienceSettings: SignInExperienceResponse = {
Expand Down Expand Up @@ -149,6 +151,8 @@ export const mockSignInExperienceSettings: SignInExperienceResponse = {
isDevelopmentTenant: false,
singleSignOnEnabled: true,
socialSignIn: {},
supportEmail: null,
supportWebsiteUrl: null,
};

const usernameSettings = {
Expand Down
4 changes: 4 additions & 0 deletions packages/experience/src/__mocks__/logto.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ export const mockSignInExperience: SignInExperience = {
},
singleSignOnEnabled: true,
socialSignIn: {},
supportEmail: null,
supportWebsiteUrl: null,
};

export const mockSignInExperienceSettings: SignInExperienceResponse = {
Expand Down Expand Up @@ -149,6 +151,8 @@ export const mockSignInExperienceSettings: SignInExperienceResponse = {
isDevelopmentTenant: false,
singleSignOnEnabled: true,
socialSignIn: {},
supportEmail: null,
supportWebsiteUrl: null,
};

const usernameSettings = {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 2 additions & 0 deletions packages/schemas/tables/sign_in_experiences.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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)
);
Loading