Skip to content

Commit 968f628

Browse files
committed
feat(core,schemas): support ui_locales param in auth request
1 parent c9f0720 commit 968f628

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

packages/core/src/oidc/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ export const buildLoginPromptUrl = (params: ExtraParamsObject, appId?: unknown):
129129
appendExtraParam(ExtraParamsKey.OneTimeToken);
130130
appendExtraParam(ExtraParamsKey.LoginHint);
131131
appendExtraParam(ExtraParamsKey.Identifier);
132+
appendExtraParam(ExtraParamsKey.UiLocales);
132133

133134
// Reuse DirectSignIn page to handle Google One Tap credential.
134135
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing

packages/schemas/src/consts/oidc.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ export enum ExtraParamsKey {
4646
* This can be used to pre-fill the identifier field **only on the first screen** of the sign-in/sign-up flow.
4747
*/
4848
LoginHint = 'login_hint',
49+
/**
50+
* The end-users preferred languages to use for the client application, represented as a space-separated list of BCP47 language tags.
51+
* E.g. `en` or `en-US` or `en-US en`.
52+
*
53+
* @see {@link https://openid.net/specs/openid-connect-core-1_0.html#rfc.section.13.2.1}
54+
*/
55+
UiLocales = 'ui_locales',
4956
/**
5057
* Specifies the identifier used in the identifier sign-in or identifier register page.
5158
*
@@ -92,6 +99,7 @@ export const extraParamsObjectGuard = z
9299
[ExtraParamsKey.DirectSignIn]: z.string(),
93100
[ExtraParamsKey.OrganizationId]: z.string(),
94101
[ExtraParamsKey.LoginHint]: z.string(),
102+
[ExtraParamsKey.UiLocales]: z.string(),
95103
[ExtraParamsKey.Identifier]: z.string(),
96104
[ExtraParamsKey.OneTimeToken]: z.string(),
97105
[ExtraParamsKey.GoogleOneTapCredential]: z.string(),
@@ -104,6 +112,7 @@ export type ExtraParamsObject = Partial<{
104112
[ExtraParamsKey.DirectSignIn]: string;
105113
[ExtraParamsKey.OrganizationId]: string;
106114
[ExtraParamsKey.LoginHint]: string;
115+
[ExtraParamsKey.UiLocales]: string;
107116
[ExtraParamsKey.Identifier]: string;
108117
[ExtraParamsKey.OneTimeToken]: string;
109118
[ExtraParamsKey.GoogleOneTapCredential]: string;

0 commit comments

Comments
 (0)