diff --git a/packages/core/src/__mocks__/sign-in-experience.ts b/packages/core/src/__mocks__/sign-in-experience.ts index 3be641ec5..19578d72d 100644 --- a/packages/core/src/__mocks__/sign-in-experience.ts +++ b/packages/core/src/__mocks__/sign-in-experience.ts @@ -28,7 +28,6 @@ export const mockSignInExperience: SignInExperience = { languageInfo: { autoDetect: true, fallbackLanguage: 'en', - fixedLanguage: 'zh-CN', }, signInMethods: { username: SignInMethodState.Primary, @@ -60,7 +59,6 @@ export const mockTermsOfUse: TermsOfUse = { export const mockLanguageInfo: LanguageInfo = { autoDetect: true, fallbackLanguage: 'en', - fixedLanguage: 'zh-CN', }; export const mockSignInMethods: SignInMethods = { diff --git a/packages/core/src/lib/sign-in-experience.test.ts b/packages/core/src/lib/sign-in-experience.test.ts index e0d054a07..4b2e398e6 100644 --- a/packages/core/src/lib/sign-in-experience.test.ts +++ b/packages/core/src/lib/sign-in-experience.test.ts @@ -78,7 +78,6 @@ describe('validate language info', () => { await validateLanguageInfo({ autoDetect: true, fallbackLanguage: 'zh-CN', - fixedLanguage: 'en', }); expect(findAllCustomLanguageTags).toBeCalledTimes(1); }); @@ -89,7 +88,6 @@ describe('validate language info', () => { validateLanguageInfo({ autoDetect: true, fallbackLanguage: builtInSupportedLanguage, - fixedLanguage: 'en', }) ).resolves.not.toThrow(); expect(findAllCustomLanguageTags).toBeCalledTimes(1); @@ -103,7 +101,6 @@ describe('validate language info', () => { validateLanguageInfo({ autoDetect: true, fallbackLanguage: customOnlySupportedLanguage, - fixedLanguage: 'en', }) ).resolves.not.toThrow(); expect(findAllCustomLanguageTags).toBeCalledTimes(1); @@ -117,7 +114,6 @@ describe('validate language info', () => { validateLanguageInfo({ autoDetect: true, fallbackLanguage: unsupportedLanguage, - fixedLanguage: 'en', }) ).rejects.toMatchError( new RequestError({ diff --git a/packages/core/src/routes/custom-phrase.test.ts b/packages/core/src/routes/custom-phrase.test.ts index 14452538d..35ecad9ac 100644 --- a/packages/core/src/routes/custom-phrase.test.ts +++ b/packages/core/src/routes/custom-phrase.test.ts @@ -57,7 +57,6 @@ const findDefaultSignInExperience = jest.fn( languageInfo: { autoDetect: true, fallbackLanguage: mockFallbackLanguage, - fixedLanguage: mockFallbackLanguage, }, }) ); diff --git a/packages/core/src/routes/phrase.content-language.test.ts b/packages/core/src/routes/phrase.content-language.test.ts index 47b2e0f37..ab0d61bee 100644 --- a/packages/core/src/routes/phrase.content-language.test.ts +++ b/packages/core/src/routes/phrase.content-language.test.ts @@ -27,7 +27,6 @@ const findDefaultSignInExperience = jest.fn(async () => ({ languageInfo: { autoDetect: true, fallbackLanguage, - fixedLanguage: fallbackLanguage, }, })); @@ -60,7 +59,6 @@ describe('when auto-detect is not enabled', () => { languageInfo: { autoDetect: false, fallbackLanguage: unsupportedLanguageX, - fixedLanguage: unsupportedLanguageX, }, }); const response = await phraseRequest @@ -76,7 +74,6 @@ describe('when auto-detect is not enabled', () => { languageInfo: { autoDetect: false, fallbackLanguage, - fixedLanguage: fallbackLanguage, }, }); }); @@ -102,7 +99,6 @@ describe('when auto-detect is enabled', () => { languageInfo: { autoDetect: true, fallbackLanguage: unsupportedLanguageX, - fixedLanguage: unsupportedLanguageX, }, }); const response = await phraseRequest @@ -118,7 +114,6 @@ describe('when auto-detect is enabled', () => { languageInfo: { autoDetect: true, fallbackLanguage, - fixedLanguage: fallbackLanguage, }, }); }); diff --git a/packages/core/src/routes/phrase.test.ts b/packages/core/src/routes/phrase.test.ts index f51f0b633..0e39b4e8c 100644 --- a/packages/core/src/routes/phrase.test.ts +++ b/packages/core/src/routes/phrase.test.ts @@ -29,7 +29,6 @@ const findDefaultSignInExperience = jest.fn( languageInfo: { autoDetect: true, fallbackLanguage: customizedLanguage, - fixedLanguage: customizedLanguage, }, }) ); @@ -147,7 +146,6 @@ describe('when the application is not admin-console', () => { languageInfo: { autoDetect: false, fallbackLanguage: customizedLanguage, - fixedLanguage: customizedLanguage, }, }); await expect(phraseRequest.get('/phrase')).resolves.toHaveProperty('status', 200); diff --git a/packages/schemas/src/foundations/jsonb-types.ts b/packages/schemas/src/foundations/jsonb-types.ts index 2ff053e7f..fd4c9f6be 100644 --- a/packages/schemas/src/foundations/jsonb-types.ts +++ b/packages/schemas/src/foundations/jsonb-types.ts @@ -1,4 +1,4 @@ -import { hexColorRegEx, languageKeys } from '@logto/core-kit'; +import { hexColorRegEx } from '@logto/core-kit'; import { languageTagGuard } from '@logto/language-kit'; import { z } from 'zod'; @@ -124,8 +124,6 @@ export type TermsOfUse = z.infer; export const languageInfoGuard = z.object({ autoDetect: z.boolean(), fallbackLanguage: languageTagGuard, - /** @deprecated */ - fixedLanguage: z.enum(languageKeys), }); export type LanguageInfo = z.infer; diff --git a/packages/schemas/src/seeds/sign-in-experience.ts b/packages/schemas/src/seeds/sign-in-experience.ts index 487612704..0f3fcc8a3 100644 --- a/packages/schemas/src/seeds/sign-in-experience.ts +++ b/packages/schemas/src/seeds/sign-in-experience.ts @@ -20,7 +20,6 @@ export const defaultSignInExperience: Readonly = { languageInfo: { autoDetect: true, fallbackLanguage: 'en', - fixedLanguage: 'en', }, termsOfUse: { enabled: false, diff --git a/packages/ui/src/__mocks__/logto.tsx b/packages/ui/src/__mocks__/logto.tsx index 38a4324ba..f057568fd 100644 --- a/packages/ui/src/__mocks__/logto.tsx +++ b/packages/ui/src/__mocks__/logto.tsx @@ -178,7 +178,6 @@ export const mockSignInExperience: SignInExperience = { languageInfo: { autoDetect: true, fallbackLanguage: 'en', - fixedLanguage: 'zh-CN', }, signInMethods: { username: SignInMethodState.Primary,