Skip to content

Commit 66b03f0

Browse files
feat: add support for ui_locale and template_id
1 parent 263e7b6 commit 66b03f0

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

playground/index.html

+14
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,18 @@ <h3 class="text-lg leading-6 font-medium text-gray-500">
168168
placeholder="Your crossid tenant (e.g., 'myorg')"
169169
autoFocus
170170
></optinput>
171+
<optinput
172+
name="uiLocales"
173+
v-model="uiLocales"
174+
label="UI Locales"
175+
autoFocus
176+
></optinput>
177+
<optinput
178+
name="templateId"
179+
v-model="templateId"
180+
label="Template ID"
181+
autoFocus
182+
></optinput>
171183
</tab>
172184
<tab id="wellKnown" name="OpenID Well Known Endpoint">
173185
<p class="text-xs text-gray-500">
@@ -765,6 +777,8 @@ <h3 class="text-lg leading-6 font-medium text-gray-500">Actions</h3>
765777
}
766778
return {
767779
tenant_id: this.tenant,
780+
ui_locales: this.uiLocales,
781+
template_id: this.templateId,
768782
...opts,
769783
}
770784
}

src/client.ts

+12
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,16 @@ export interface BaseClientOpts extends Partial<BaseAuthorizationCodeParams> {
9393
* Default: 'memory'
9494
*/
9595
cache_type?: typeof CACHE_INMEM | typeof CACHE_LS | typeof CACHE_SS
96+
97+
/**
98+
* Defines the default locales to request for the login/consent ui
99+
*/
100+
ui_locales?: string
101+
102+
/**
103+
* The template ID to display in the login/consent flow
104+
*/
105+
template_id?: string
96106
}
97107

98108
/**
@@ -580,6 +590,8 @@ export default class CrossidClient {
580590
scope: this.getFinalScope(opts.scope).join(' '),
581591
code_challenge: opts.code_challenge,
582592
code_challenge_method: 'S256',
593+
ui_locales: opts.ui_locales || this.opts.ui_locales,
594+
template_id: opts.template_id || this.opts.template_id,
583595
}
584596
}
585597

src/types.ts

+2
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ export interface AuthorizationRequest {
8484
scope: string
8585
code_challenge: string
8686
code_challenge_method: string
87+
ui_locales?: string
88+
template_id?: string
8789
}
8890

8991
// AuthorizationCodeData returns the data required in order to process an authorization code request

0 commit comments

Comments
 (0)