Factorise LoginUserProfile and LoginUpdateProfile

This commit is contained in:
Joseph Garrone
2024-05-08 16:10:03 +02:00
parent f97d33ffc1
commit 58dfd3c25c
5 changed files with 59 additions and 216 deletions

View File

@ -31,7 +31,6 @@ export type KcContext =
| KcContext.LoginPageExpired
| KcContext.LoginConfigTotp
| KcContext.LogoutConfirm
| KcContext.UpdateUserProfile
| KcContext.IdpReviewUserProfile
| KcContext.UpdateEmail
| KcContext.SelectAuthenticator
@ -362,17 +361,6 @@ export declare namespace KcContext {
username: string;
};
export type LoginUpdateProfile = Common & {
pageId: "login-update-profile.ftl";
user: {
editUsernameAllowed: boolean;
username?: string;
email?: string;
firstName?: string;
lastName?: string;
};
};
export type LoginIdpLinkConfirm = Common & {
pageId: "login-idp-link-confirm.ftl";
idpAlias: string;
@ -432,14 +420,27 @@ export declare namespace KcContext {
};
};
export type UpdateUserProfile = Common & {
pageId: "update-user-profile.ftl";
export type LoginUpdateProfile = Common & {
pageId: "login-update-profile.ftl" | "update-user-profile.ftl";
profile: {
attributes: Attribute[];
attributesByName: Record<string, Attribute>;
};
};
/*
export type LoginUpdateProfile = Common & {
pageId: "login-update-profile.ftl";
user: {
editUsernameAllowed: boolean;
username?: string;
email?: string;
firstName?: string;
lastName?: string;
};
};
*/
export type IdpReviewUserProfile = Common & {
pageId: "idp-review-user-profile.ftl";
profile: {