93 lines
2.8 KiB
TypeScript
93 lines
2.8 KiB
TypeScript
|
import type { KcLanguageTag } from "./i18n/KcLanguageTag";
|
||
|
export declare type KcContext = KcContext.Login | KcContext.Register;
|
||
|
export declare namespace KcContext {
|
||
|
type Template = {
|
||
|
url: {
|
||
|
loginAction: string;
|
||
|
resourcesPath: string;
|
||
|
resourcesCommonPath: string;
|
||
|
loginRestartFlowUrl: string;
|
||
|
loginUrl: string;
|
||
|
};
|
||
|
realm: {
|
||
|
displayName?: string;
|
||
|
displayNameHtml?: string;
|
||
|
internationalizationEnabled: boolean;
|
||
|
password: boolean;
|
||
|
registrationEmailAsUsername: boolean;
|
||
|
};
|
||
|
/** Undefined if !realm.internationalizationEnabled */
|
||
|
locale?: {
|
||
|
supported: {
|
||
|
languageTag: KcLanguageTag;
|
||
|
}[];
|
||
|
};
|
||
|
auth?: {
|
||
|
showUsername: boolean;
|
||
|
showResetCredentials: boolean;
|
||
|
showTryAnotherWayLink: boolean;
|
||
|
attemptedUsername?: boolean;
|
||
|
};
|
||
|
scripts: string[];
|
||
|
message?: {
|
||
|
type: "success" | "warning" | "error" | "info";
|
||
|
summary: string;
|
||
|
};
|
||
|
isAppInitiatedAction: boolean;
|
||
|
};
|
||
|
type Login = Template & {
|
||
|
pageBasename: "login.ftl";
|
||
|
url: {
|
||
|
loginResetCredentialsUrl: string;
|
||
|
registrationUrl: string;
|
||
|
};
|
||
|
realm: {
|
||
|
loginWithEmailAllowed: boolean;
|
||
|
rememberMe: boolean;
|
||
|
resetPasswordAllowed: boolean;
|
||
|
registrationAllowed: boolean;
|
||
|
};
|
||
|
auth: {
|
||
|
selectedCredential?: string;
|
||
|
};
|
||
|
registrationDisabled: boolean;
|
||
|
login: {
|
||
|
username?: string;
|
||
|
rememberMe: boolean;
|
||
|
};
|
||
|
usernameEditDisabled: boolean;
|
||
|
social: {
|
||
|
displayInfo: boolean;
|
||
|
providers?: {
|
||
|
loginUrl: string;
|
||
|
alias: string;
|
||
|
providerId: string;
|
||
|
displayName: string;
|
||
|
}[];
|
||
|
};
|
||
|
};
|
||
|
type Register = Template & {
|
||
|
pageBasename: "register.ftl";
|
||
|
url: {
|
||
|
registrationAction: string;
|
||
|
};
|
||
|
messagesPerField: {
|
||
|
printIfExists<T>(key: "userLabel" | "username" | "email" | "firstName" | "lastName" | "password" | "password-confirm", x: T): T | undefined;
|
||
|
};
|
||
|
register: {
|
||
|
formData: {
|
||
|
firstName?: string;
|
||
|
displayName?: string;
|
||
|
lastName?: string;
|
||
|
email?: string;
|
||
|
username?: string;
|
||
|
};
|
||
|
};
|
||
|
passwordRequired: boolean;
|
||
|
recaptchaRequired: boolean;
|
||
|
/** undefined if !recaptchaRequired */
|
||
|
recaptchaSiteKey?: string;
|
||
|
};
|
||
|
}
|
||
|
export declare const kcContext: KcContext | undefined;
|