From ca8f82423a056e6f6f6ddc07fde174f9c832cca4 Mon Sep 17 00:00:00 2001 From: Livio Spring Date: Wed, 28 Aug 2024 07:33:20 +0200 Subject: [PATCH] fix: automatically link user without prompt (#8487) # Which Problems Are Solved There were UX issue with the autolinking prompt page and users were not able to link their account or would not understand what to do. Since the trust to the IdP is already bound by the configuration, the user can directly be linked without any user input. # How the Problems Are Solved - remove the prompt page and directly link the user if possible - remove corresponding customization texts from the API and Console # Additional Changes None # Additional Context - relates to https://github.com/zitadel/zitadel/issues/7977 - discussed with customers - created as a `fix` to be able to backport --------- Co-authored-by: Max Peintner --- .../modules/policies/login-texts/helper.ts | 8 -- .../login-texts/login-texts.component.ts | 1 - console/src/assets/i18n/bg.json | 1 - console/src/assets/i18n/cs.json | 1 - console/src/assets/i18n/de.json | 1 - console/src/assets/i18n/en.json | 1 - console/src/assets/i18n/es.json | 1 - console/src/assets/i18n/fr.json | 1 - console/src/assets/i18n/it.json | 1 - console/src/assets/i18n/ja.json | 1 - console/src/assets/i18n/mk.json | 1 - console/src/assets/i18n/nl.json | 1 - console/src/assets/i18n/pl.json | 1 - console/src/assets/i18n/pt.json | 1 - console/src/assets/i18n/ru.json | 1 - console/src/assets/i18n/sv.json | 1 - console/src/assets/i18n/zh.json | 1 - .../api/grpc/admin/custom_text_converter.go | 1 - internal/api/grpc/admin/export.go | 1 - .../grpc/management/custom_text_converter.go | 1 - internal/api/grpc/text/custom_text.go | 19 --- .../api/ui/login/external_provider_handler.go | 18 ++- internal/api/ui/login/link_prompt_handler.go | 62 --------- internal/api/ui/login/renderer.go | 1 - internal/api/ui/login/router.go | 1 - .../static/templates/link_user_prompt.html | 37 ------ internal/command/custom_login_text.go | 22 ---- internal/command/custom_login_text_model.go | 46 ------- .../instance_custom_login_text_test.go | 121 ------------------ .../command/org_custom_login_text_test.go | 117 ----------------- internal/domain/custom_login_text.go | 14 -- internal/query/custom_text.go | 18 --- proto/zitadel/admin.proto | 3 +- proto/zitadel/management.proto | 3 +- proto/zitadel/text.proto | 3 +- 35 files changed, 21 insertions(+), 491 deletions(-) delete mode 100644 internal/api/ui/login/link_prompt_handler.go delete mode 100644 internal/api/ui/login/static/templates/link_user_prompt.html diff --git a/console/src/app/modules/policies/login-texts/helper.ts b/console/src/app/modules/policies/login-texts/helper.ts index 355b26706..b0016955f 100644 --- a/console/src/app/modules/policies/login-texts/helper.ts +++ b/console/src/app/modules/policies/login-texts/helper.ts @@ -15,7 +15,6 @@ import { InitPasswordDoneScreenText, InitPasswordScreenText, LinkingUserDoneScreenText, - LinkingUserPromptScreenText, LoginScreenText, LogoutDoneScreenText, MFAProvidersText, @@ -377,12 +376,5 @@ export function mapRequestValues(map: Partial, req: Req): Req { r34.setUsernameLabel(map.externalRegistrationUserOverviewText?.usernameLabel ?? ''); req.setExternalRegistrationUserOverviewText(r34); - const r35 = new LinkingUserPromptScreenText(); - r35.setTitle(map.linkingUserPromptText?.title ?? ''); - r35.setDescription(map.linkingUserPromptText?.description ?? ''); - r35.setLinkButtonText(map.linkingUserPromptText?.linkButtonText ?? ''); - r35.setOtherButtonText(map.linkingUserPromptText?.otherButtonText ?? ''); - req.setLinkingUserPromptText(r35); - return req; } diff --git a/console/src/app/modules/policies/login-texts/login-texts.component.ts b/console/src/app/modules/policies/login-texts/login-texts.component.ts index 695e757f5..b0a846cb6 100644 --- a/console/src/app/modules/policies/login-texts/login-texts.component.ts +++ b/console/src/app/modules/policies/login-texts/login-texts.component.ts @@ -41,7 +41,6 @@ const KeyNamesArray = [ 'initPasswordText', 'initializeDoneText', 'initializeUserText', - 'linkingUserPromptText', 'linkingUserDoneText', 'loginText', 'logoutText', diff --git a/console/src/assets/i18n/bg.json b/console/src/assets/i18n/bg.json index e8b8ade07..3548608b5 100644 --- a/console/src/assets/i18n/bg.json +++ b/console/src/assets/i18n/bg.json @@ -1627,7 +1627,6 @@ "initPasswordText": "Инициализиране на парола", "initializeDoneText": "Инициализирането на потребителя е готово", "initializeUserText": "Инициализирайте потребителя", - "linkingUserPromptText": "Потребителският промпт за свързване", "linkingUserDoneText": "Свързването на потребителя е готово", "loginText": "Влизам", "logoutText": "Излез от профила си", diff --git a/console/src/assets/i18n/cs.json b/console/src/assets/i18n/cs.json index 8cdbc69e6..18d9e9f27 100644 --- a/console/src/assets/i18n/cs.json +++ b/console/src/assets/i18n/cs.json @@ -1628,7 +1628,6 @@ "initPasswordText": "Inicializace hesla", "initializeDoneText": "Inicializace uživatele dokončena", "initializeUserText": "Inicializace uživatele", - "linkingUserPromptText": "Uživatelský propojovací text", "linkingUserDoneText": "Propojení uživatele dokončeno", "loginText": "Přihlášení", "logoutText": "Odhlášení", diff --git a/console/src/assets/i18n/de.json b/console/src/assets/i18n/de.json index 2ffdb74e8..7d86f1a61 100644 --- a/console/src/assets/i18n/de.json +++ b/console/src/assets/i18n/de.json @@ -1628,7 +1628,6 @@ "initPasswordText": "Passwort Initialisierung", "initializeDoneText": "Benutzereinrichtung erfolgreich", "initializeUserText": "Benutzereinrichtung", - "linkingUserPromptText": "Aufforderung zur Benutzerverlinkung", "linkingUserDoneText": "Benutzerverlinkung erfolgreich", "loginText": "Anmelden", "logoutText": "Abmelden", diff --git a/console/src/assets/i18n/en.json b/console/src/assets/i18n/en.json index fefbb5bfb..2c4efd5fd 100644 --- a/console/src/assets/i18n/en.json +++ b/console/src/assets/i18n/en.json @@ -1628,7 +1628,6 @@ "initPasswordText": "Initialize password", "initializeDoneText": "Initialize user done", "initializeUserText": "Initialize user", - "linkingUserPromptText": "Linking user prompt", "linkingUserDoneText": "Linking user done", "loginText": "Login", "logoutText": "Logout", diff --git a/console/src/assets/i18n/es.json b/console/src/assets/i18n/es.json index 61867dbc7..5e6d090eb 100644 --- a/console/src/assets/i18n/es.json +++ b/console/src/assets/i18n/es.json @@ -1629,7 +1629,6 @@ "initPasswordText": "Inicializar contraseña", "initializeDoneText": "Inicializar usuario, hecho", "initializeUserText": "Inicializar usuario", - "linkingUserPromptText": "Mensaje de enlace de usuario", "linkingUserDoneText": "Vinculación de usuario, hecho", "loginText": "Iniciar sesión", "logoutText": "Cerrar sesión", diff --git a/console/src/assets/i18n/fr.json b/console/src/assets/i18n/fr.json index fb250f06c..ecd76cc51 100644 --- a/console/src/assets/i18n/fr.json +++ b/console/src/assets/i18n/fr.json @@ -1628,7 +1628,6 @@ "initPasswordText": "Initialiser le mot de passe", "initializeDoneText": "Initialiser l'utilisateur terminé", "initializeUserText": "Initialiser l'utilisateur", - "linkingUserPromptText": "Message de liaison utilisateur", "linkingUserDoneText": "Lier l'utilisateur fait", "loginText": "Connexion", "logoutText": "Déconnexion", diff --git a/console/src/assets/i18n/it.json b/console/src/assets/i18n/it.json index 96206462c..2e1d5b8ed 100644 --- a/console/src/assets/i18n/it.json +++ b/console/src/assets/i18n/it.json @@ -1628,7 +1628,6 @@ "initPasswordText": "Inizializzazione della password", "initializeDoneText": "Inizializzazione utente finita", "initializeUserText": "Inizializzazione utente", - "linkingUserPromptText": "Testo di promemoria per collegare l'utente", "linkingUserDoneText": "Collegamento dell'utente finito", "loginText": "Accesso", "logoutText": "Logout", diff --git a/console/src/assets/i18n/ja.json b/console/src/assets/i18n/ja.json index aa89b52a8..523a553a2 100644 --- a/console/src/assets/i18n/ja.json +++ b/console/src/assets/i18n/ja.json @@ -1624,7 +1624,6 @@ "initPasswordText": "パスワードを初期化する", "initializeDoneText": "ユーザーの初期化が完了しました", "initializeUserText": "ユーザーを初期化する", - "linkingUserPromptText": "ユーザーのリンクプロンプト", "linkingUserDoneText": "ユーザーのリンクが完了しました", "loginText": "ログイン", "logoutText": "ログアウト", diff --git a/console/src/assets/i18n/mk.json b/console/src/assets/i18n/mk.json index 847e22126..2f925e40c 100644 --- a/console/src/assets/i18n/mk.json +++ b/console/src/assets/i18n/mk.json @@ -1629,7 +1629,6 @@ "initPasswordText": "Иницијализација на лозинка", "initializeDoneText": "Иницијализацијата на корисникот е завршена", "initializeUserText": "Иницијализација на корисник", - "linkingUserPromptText": "Поврзување на кориснички промпт", "linkingUserDoneText": "Поврзувањето на корисникот е завршено", "loginText": "Најава", "logoutText": "Одјава", diff --git a/console/src/assets/i18n/nl.json b/console/src/assets/i18n/nl.json index 9e494b3dc..2832d4321 100644 --- a/console/src/assets/i18n/nl.json +++ b/console/src/assets/i18n/nl.json @@ -1628,7 +1628,6 @@ "initPasswordText": "Initialiseer wachtwoord", "initializeDoneText": "Gebruiker initialisatie voltooid", "initializeUserText": "Initialiseer gebruiker", - "linkingUserPromptText": "Gebruiker koppelingsprompt", "linkingUserDoneText": "Gebruiker koppeling voltooid", "loginText": "Login", "logoutText": "Uitloggen", diff --git a/console/src/assets/i18n/pl.json b/console/src/assets/i18n/pl.json index 3caf7f39c..70f0b18d7 100644 --- a/console/src/assets/i18n/pl.json +++ b/console/src/assets/i18n/pl.json @@ -1627,7 +1627,6 @@ "initPasswordText": "Inicjalizacja hasła", "initializeDoneText": "Inicjalizacja użytkownika zakończona", "initializeUserText": "Inicjalizacja użytkownika", - "linkingUserPromptText": "Komunikat o łączeniu użytkowników", "linkingUserDoneText": "Łączenie użytkownika zakończone", "loginText": "Zaloguj się", "logoutText": "Wyloguj się", diff --git a/console/src/assets/i18n/pt.json b/console/src/assets/i18n/pt.json index c40f63535..0010158ed 100644 --- a/console/src/assets/i18n/pt.json +++ b/console/src/assets/i18n/pt.json @@ -1629,7 +1629,6 @@ "initPasswordText": "Inicialização de senha", "initializeDoneText": "Inicialização de usuário concluída", "initializeUserText": "Inicializaçãode usuário", - "linkingUserPromptText": "Prompt de usuário para vinculação", "linkingUserDoneText": "Vinculação de usuário concluída", "loginText": "Login", "logoutText": "Logout", diff --git a/console/src/assets/i18n/ru.json b/console/src/assets/i18n/ru.json index 532aa2ba9..98a715981 100644 --- a/console/src/assets/i18n/ru.json +++ b/console/src/assets/i18n/ru.json @@ -1693,7 +1693,6 @@ "initPasswordText": "Инициализировать пароль", "initializeDoneText": "Инициализация пользователя выполнена", "initializeUserText": "Инициализировать пользователя", - "linkingUserPromptText": "Текст приглашения к привязке пользователя", "linkingUserDoneText": "Привязка пользователя выполнена", "loginText": "Вход", "logoutText": "Выход", diff --git a/console/src/assets/i18n/sv.json b/console/src/assets/i18n/sv.json index 13333a4c3..894b87c2c 100644 --- a/console/src/assets/i18n/sv.json +++ b/console/src/assets/i18n/sv.json @@ -1632,7 +1632,6 @@ "initPasswordText": "Initiera lösenord", "initializeDoneText": "Initiera användare klart", "initializeUserText": "Initiera användare", - "linkingUserPromptText": "Länka användarprompt", "linkingUserDoneText": "Länka användare klart", "loginText": "Inloggning", "logoutText": "Utloggning", diff --git a/console/src/assets/i18n/zh.json b/console/src/assets/i18n/zh.json index d273750ad..dabf8261f 100644 --- a/console/src/assets/i18n/zh.json +++ b/console/src/assets/i18n/zh.json @@ -1627,7 +1627,6 @@ "initPasswordText": "初始化密码", "initializeDoneText": "初始化用户完成", "initializeUserText": "初始化用户", - "linkingUserPromptText": "用户链接提示", "linkingUserDoneText": "链接用户完成", "loginText": "登录", "logoutText": "登出", diff --git a/internal/api/grpc/admin/custom_text_converter.go b/internal/api/grpc/admin/custom_text_converter.go index 4bb76b361..a7471525d 100644 --- a/internal/api/grpc/admin/custom_text_converter.go +++ b/internal/api/grpc/admin/custom_text_converter.go @@ -172,7 +172,6 @@ func SetLoginTextToDomain(req *admin_pb.SetCustomLoginTextsRequest) *domain.Cust result.RegistrationUser = text.RegistrationUserScreenTextPbToDomain(req.RegistrationUserText) result.ExternalRegistrationUserOverview = text.ExternalRegistrationUserOverviewScreenTextPbToDomain(req.ExternalRegistrationUserOverviewText) result.RegistrationOrg = text.RegistrationOrgScreenTextPbToDomain(req.RegistrationOrgText) - result.LinkingUserPrompt = text.LinkingUserPromptScreenTextPbToDomain(req.LinkingUserPromptText) result.LinkingUsersDone = text.LinkingUserDoneScreenTextPbToDomain(req.LinkingUserDoneText) result.ExternalNotFound = text.ExternalUserNotFoundScreenTextPbToDomain(req.ExternalUserNotFoundText) result.LoginSuccess = text.SuccessLoginScreenTextPbToDomain(req.SuccessLoginText) diff --git a/internal/api/grpc/admin/export.go b/internal/api/grpc/admin/export.go index dfb0cd346..408a1a59f 100644 --- a/internal/api/grpc/admin/export.go +++ b/internal/api/grpc/admin/export.go @@ -1063,7 +1063,6 @@ func (s *Server) getCustomLoginTexts(ctx context.Context, org string, languages RegistrationUserText: text_grpc.RegistrationUserScreenTextToPb(text.RegistrationUser), ExternalRegistrationUserOverviewText: text_grpc.ExternalRegistrationUserOverviewScreenTextToPb(text.ExternalRegistrationUserOverview), RegistrationOrgText: text_grpc.RegistrationOrgScreenTextToPb(text.RegistrationOrg), - LinkingUserPromptText: text_grpc.LinkingUserPromptScreenTextToPb(text.LinkingUserPrompt), LinkingUserDoneText: text_grpc.LinkingUserDoneScreenTextToPb(text.LinkingUsersDone), ExternalUserNotFoundText: text_grpc.ExternalUserNotFoundScreenTextToPb(text.ExternalNotFound), SuccessLoginText: text_grpc.SuccessLoginScreenTextToPb(text.LoginSuccess), diff --git a/internal/api/grpc/management/custom_text_converter.go b/internal/api/grpc/management/custom_text_converter.go index aa5aa05a6..06dfed6a8 100644 --- a/internal/api/grpc/management/custom_text_converter.go +++ b/internal/api/grpc/management/custom_text_converter.go @@ -171,7 +171,6 @@ func SetLoginCustomTextToDomain(req *mgmt_pb.SetCustomLoginTextsRequest) *domain result.RegistrationUser = text.RegistrationUserScreenTextPbToDomain(req.RegistrationUserText) result.ExternalRegistrationUserOverview = text.ExternalRegistrationUserOverviewScreenTextPbToDomain(req.ExternalRegistrationUserOverviewText) result.RegistrationOrg = text.RegistrationOrgScreenTextPbToDomain(req.RegistrationOrgText) - result.LinkingUserPrompt = text.LinkingUserPromptScreenTextPbToDomain(req.LinkingUserPromptText) result.LinkingUsersDone = text.LinkingUserDoneScreenTextPbToDomain(req.LinkingUserDoneText) result.ExternalNotFound = text.ExternalUserNotFoundScreenTextPbToDomain(req.ExternalUserNotFoundText) result.LoginSuccess = text.SuccessLoginScreenTextPbToDomain(req.SuccessLoginText) diff --git a/internal/api/grpc/text/custom_text.go b/internal/api/grpc/text/custom_text.go index 82e77cbbc..28899278c 100644 --- a/internal/api/grpc/text/custom_text.go +++ b/internal/api/grpc/text/custom_text.go @@ -64,7 +64,6 @@ func CustomLoginTextToPb(text *domain.CustomLoginText) *text_pb.LoginCustomText RegistrationUserText: RegistrationUserScreenTextToPb(text.RegistrationUser), ExternalRegistrationUserOverviewText: ExternalRegistrationUserOverviewScreenTextToPb(text.ExternalRegistrationUserOverview), RegistrationOrgText: RegistrationOrgScreenTextToPb(text.RegistrationOrg), - LinkingUserPromptText: LinkingUserPromptScreenTextToPb(text.LinkingUserPrompt), LinkingUserDoneText: LinkingUserDoneScreenTextToPb(text.LinkingUsersDone), ExternalUserNotFoundText: ExternalUserNotFoundScreenTextToPb(text.ExternalNotFound), SuccessLoginText: SuccessLoginScreenTextToPb(text.LoginSuccess), @@ -424,15 +423,6 @@ func LinkingUserDoneScreenTextToPb(text domain.LinkingUserDoneScreenText) *text_ } } -func LinkingUserPromptScreenTextToPb(text domain.LinkingUserPromptScreenText) *text_pb.LinkingUserPromptScreenText { - return &text_pb.LinkingUserPromptScreenText{ - Title: text.Title, - Description: text.Description, - LinkButtonText: text.LinkButtonText, - OtherButtonText: text.OtherButtonText, - } -} - func ExternalUserNotFoundScreenTextToPb(text domain.ExternalUserNotFoundScreenText) *text_pb.ExternalUserNotFoundScreenText { return &text_pb.ExternalUserNotFoundScreenText{ Title: text.Title, @@ -902,15 +892,6 @@ func RegistrationOrgScreenTextPbToDomain(text *text_pb.RegistrationOrgScreenText } } -func LinkingUserPromptScreenTextPbToDomain(text *text_pb.LinkingUserPromptScreenText) domain.LinkingUserPromptScreenText { - return domain.LinkingUserPromptScreenText{ - Title: text.GetTitle(), - Description: text.GetDescription(), - LinkButtonText: text.GetLinkButtonText(), - OtherButtonText: text.GetOtherButtonText(), - } -} - func LinkingUserDoneScreenTextPbToDomain(text *text_pb.LinkingUserDoneScreenText) domain.LinkingUserDoneScreenText { if text == nil { return domain.LinkingUserDoneScreenText{} diff --git a/internal/api/ui/login/external_provider_handler.go b/internal/api/ui/login/external_provider_handler.go index b9798bbcd..1f835c855 100644 --- a/internal/api/ui/login/external_provider_handler.go +++ b/internal/api/ui/login/external_provider_handler.go @@ -455,9 +455,9 @@ func (l *Login) handleExternalUserAuthenticated( // checkAutoLinking checks if a user with the provided information (username or email) already exists within ZITADEL. // The decision, which information will be checked is based on the IdP template option. // The function returns a boolean whether a user was found or not. +// If single a user was found, it will be automatically linked. func (l *Login) checkAutoLinking(w http.ResponseWriter, r *http.Request, authReq *domain.AuthRequest, provider *query.IDPTemplate, externalUser *domain.ExternalUser) bool { queries := make([]query.SearchQuery, 0, 2) - var user *query.NotifyUser switch provider.AutoLinking { case domain.AutoLinkingOptionUnspecified: // is auto linking is disable, we shouldn't even get here, but in case we do we can directly return @@ -472,7 +472,7 @@ func (l *Login) checkAutoLinking(w http.ResponseWriter, r *http.Request, authReq if err != nil { return false } - l.renderLinkingUserPrompt(w, r, authReq, user, nil) + l.autoLinkUser(w, r, authReq, user) return true } // If a specific org has been requested, we'll check the provided username against usernames (of that org). @@ -501,10 +501,22 @@ func (l *Login) checkAutoLinking(w http.ResponseWriter, r *http.Request, authReq if err != nil { return false } - l.renderLinkingUserPrompt(w, r, authReq, user, nil) + l.autoLinkUser(w, r, authReq, user) return true } +func (l *Login) autoLinkUser(w http.ResponseWriter, r *http.Request, authReq *domain.AuthRequest, user *query.NotifyUser) { + if err := l.authRepo.SelectUser(r.Context(), authReq.ID, user.ID, authReq.AgentID); err != nil { + l.renderError(w, r, authReq, err) + return + } + if err := l.authRepo.LinkExternalUsers(r.Context(), authReq.ID, authReq.AgentID, domain.BrowserInfoFromRequest(r)); err != nil { + l.renderError(w, r, authReq, err) + return + } + l.renderNextStep(w, r, authReq) +} + // externalUserNotExisting is called if an externalAuthentication couldn't find a corresponding externalID // possible solutions are: // diff --git a/internal/api/ui/login/link_prompt_handler.go b/internal/api/ui/login/link_prompt_handler.go deleted file mode 100644 index 30ac18629..000000000 --- a/internal/api/ui/login/link_prompt_handler.go +++ /dev/null @@ -1,62 +0,0 @@ -package login - -import ( - "net/http" - - "github.com/zitadel/zitadel/internal/domain" - "github.com/zitadel/zitadel/internal/query" -) - -const ( - tmplLinkingUserPrompt = "link_user_prompt" -) - -type linkingUserPromptData struct { - userData - Username string - Linking domain.AutoLinkingOption - UserID string -} - -type linkingUserPromptFormData struct { - OtherUser bool `schema:"other"` - UserID string `schema:"userID"` -} - -func (l *Login) renderLinkingUserPrompt(w http.ResponseWriter, r *http.Request, authReq *domain.AuthRequest, user *query.NotifyUser, err error) { - var errID, errMessage string - if err != nil { - errID, errMessage = l.getErrorMessage(r, err) - } - translator := l.getTranslator(r.Context(), authReq) - identification := user.PreferredLoginName - // hide the suffix in case the option is set and the auth request has been started with the primary domain scope - if authReq.RequestedOrgDomain && authReq.LabelPolicy != nil && authReq.LabelPolicy.HideLoginNameSuffix { - identification = user.Username - } - data := &linkingUserPromptData{ - Username: identification, - UserID: user.ID, - userData: l.getUserData(r, authReq, translator, "LinkingUserPrompt.Title", "LinkingUserPrompt.Description", errID, errMessage), - } - l.renderer.RenderTemplate(w, r, translator, l.renderer.Templates[tmplLinkingUserPrompt], data, nil) -} - -func (l *Login) handleLinkingUserPrompt(w http.ResponseWriter, r *http.Request) { - data := new(linkingUserPromptFormData) - authReq, err := l.ensureAuthRequestAndParseData(r, data) - if err != nil { - l.renderLogin(w, r, authReq, err) - return - } - if data.OtherUser { - l.renderExternalNotFoundOption(w, r, authReq, nil, nil, nil, nil) - return - } - err = l.authRepo.SelectUser(r.Context(), authReq.ID, data.UserID, authReq.AgentID) - if err != nil { - l.renderLogin(w, r, authReq, err) - return - } - l.renderNextStep(w, r, authReq) -} diff --git a/internal/api/ui/login/renderer.go b/internal/api/ui/login/renderer.go index 462e3fed9..3cfcb60cf 100644 --- a/internal/api/ui/login/renderer.go +++ b/internal/api/ui/login/renderer.go @@ -83,7 +83,6 @@ func CreateRenderer(pathPrefix string, staticStorage static.Storage, cookieName tmplLDAPLogin: "ldap_login.html", tmplDeviceAuthUserCode: "device_usercode.html", tmplDeviceAuthAction: "device_action.html", - tmplLinkingUserPrompt: "link_user_prompt.html", } funcs := map[string]interface{}{ "resourceUrl": func(file string) string { diff --git a/internal/api/ui/login/router.go b/internal/api/ui/login/router.go index 1e5a297b0..a815784af 100644 --- a/internal/api/ui/login/router.go +++ b/internal/api/ui/login/router.go @@ -124,6 +124,5 @@ func CreateRouter(login *Login, interceptors ...mux.MiddlewareFunc) *mux.Router router.SkipClean(true).Handle("", http.RedirectHandler(HandlerPrefix+"/", http.StatusMovedPermanently)) router.HandleFunc(EndpointDeviceAuth, login.handleDeviceAuthUserCode).Methods(http.MethodGet, http.MethodPost) router.HandleFunc(EndpointDeviceAuthAction, login.handleDeviceAuthAction).Methods(http.MethodGet, http.MethodPost) - router.HandleFunc(EndpointLinkingUserPrompt, login.handleLinkingUserPrompt).Methods(http.MethodPost) return router } diff --git a/internal/api/ui/login/static/templates/link_user_prompt.html b/internal/api/ui/login/static/templates/link_user_prompt.html deleted file mode 100644 index 9d6ed36cd..000000000 --- a/internal/api/ui/login/static/templates/link_user_prompt.html +++ /dev/null @@ -1,37 +0,0 @@ -{{template "main-top" .}} - -
-

{{t "LinkingUserPrompt.Title"}}

-

- {{t "LinkingUserPrompt.Description"}}
- {{.Username}} -

-
- - -
- - {{ .CSRF }} - - - - - {{template "error-message" .}} - -
- - - - - - -
- -
- - - - - - -{{template "main-bottom" .}} diff --git a/internal/command/custom_login_text.go b/internal/command/custom_login_text.go index 6d4223c4e..de430537a 100644 --- a/internal/command/custom_login_text.go +++ b/internal/command/custom_login_text.go @@ -42,7 +42,6 @@ func (c *Commands) createAllLoginTextEvents(ctx context.Context, agg *eventstore events = append(events, c.createRegistrationUserEvents(ctx, agg, existingText, text, defaultText)...) events = append(events, c.createExternalRegistrationUserOverviewEvents(ctx, agg, existingText, text, defaultText)...) events = append(events, c.createRegistrationOrgEvents(ctx, agg, existingText, text, defaultText)...) - events = append(events, c.createLinkingUserPromptEvents(ctx, agg, existingText, text, defaultText)...) events = append(events, c.createLinkingUserDoneEvents(ctx, agg, existingText, text, defaultText)...) events = append(events, c.createExternalUserNotFoundEvents(ctx, agg, existingText, text, defaultText)...) events = append(events, c.createSuccessLoginEvents(ctx, agg, existingText, text, defaultText)...) @@ -984,27 +983,6 @@ func (c *Commands) createRegistrationOrgEvents(ctx context.Context, agg *eventst return events } -func (c *Commands) createLinkingUserPromptEvents(ctx context.Context, agg *eventstore.Aggregate, existingText *CustomLoginTextReadModel, text *domain.CustomLoginText, defaultText bool) []eventstore.Command { - events := make([]eventstore.Command, 0) - event := c.createCustomLoginTextEvent(ctx, agg, domain.LoginKeyLinkingUserPromptTitle, existingText.LinkingUserPromptTitle, text.LinkingUserPrompt.Title, text.Language, defaultText) - if event != nil { - events = append(events, event) - } - event = c.createCustomLoginTextEvent(ctx, agg, domain.LoginKeyLinkingUserPromptDescription, existingText.LinkingUserPromptDescription, text.LinkingUserPrompt.Description, text.Language, defaultText) - if event != nil { - events = append(events, event) - } - event = c.createCustomLoginTextEvent(ctx, agg, domain.LoginKeyLinkingUserPromptLinkButtonText, existingText.LinkingUserPromptLinkButtonText, text.LinkingUserPrompt.LinkButtonText, text.Language, defaultText) - if event != nil { - events = append(events, event) - } - event = c.createCustomLoginTextEvent(ctx, agg, domain.LoginKeyLinkingUserPromptOtherButtonText, existingText.LinkingUserPromptOtherButtonText, text.LinkingUserPrompt.OtherButtonText, text.Language, defaultText) - if event != nil { - events = append(events, event) - } - return events -} - func (c *Commands) createLinkingUserDoneEvents(ctx context.Context, agg *eventstore.Aggregate, existingText *CustomLoginTextReadModel, text *domain.CustomLoginText, defaultText bool) []eventstore.Command { events := make([]eventstore.Command, 0) event := c.createCustomLoginTextEvent(ctx, agg, domain.LoginKeyLinkingUserDoneTitle, existingText.LinkingUserDoneTitle, text.LinkingUsersDone.Title, text.Language, defaultText) diff --git a/internal/command/custom_login_text_model.go b/internal/command/custom_login_text_model.go index 36ca04a62..919765611 100644 --- a/internal/command/custom_login_text_model.go +++ b/internal/command/custom_login_text_model.go @@ -422,10 +422,6 @@ func (wm *CustomLoginTextReadModel) Reduce() error { wm.handleRegistrationOrgScreenSetEvent(e) continue } - if strings.HasPrefix(e.Key, domain.LoginKeyLinkingUserPrompt) { - wm.handleLinkingUserPromptScreenSetEvent(e) - continue - } if strings.HasPrefix(e.Key, domain.LoginKeyLinkingUserDone) { wm.handleLinkingUserDoneScreenSetEvent(e) continue @@ -566,10 +562,6 @@ func (wm *CustomLoginTextReadModel) Reduce() error { wm.handleRegistrationOrgScreenRemoveEvent(e) continue } - if strings.HasPrefix(e.Key, domain.LoginKeyLinkingUserPrompt) { - wm.handleLinkingUserPromptRemoveEvent(e) - continue - } if strings.HasPrefix(e.Key, domain.LoginKeyLinkingUserDone) { wm.handleLinkingUserDoneRemoveEvent(e) continue @@ -2345,25 +2337,6 @@ func (wm *CustomLoginTextReadModel) handleRegistrationOrgScreenRemoveEvent(e *po } } -func (wm *CustomLoginTextReadModel) handleLinkingUserPromptScreenSetEvent(e *policy.CustomTextSetEvent) { - if e.Key == domain.LoginKeyLinkingUserPromptTitle { - wm.LinkingUserPromptTitle = e.Text - return - } - if e.Key == domain.LoginKeyLinkingUserPromptDescription { - wm.LinkingUserPromptDescription = e.Text - return - } - if e.Key == domain.LoginKeyLinkingUserPromptLinkButtonText { - wm.LinkingUserPromptLinkButtonText = e.Text - return - } - if e.Key == domain.LoginKeyLinkingUserPromptOtherButtonText { - wm.LinkingUserPromptOtherButtonText = e.Text - return - } -} - func (wm *CustomLoginTextReadModel) handleLinkingUserDoneScreenSetEvent(e *policy.CustomTextSetEvent) { if e.Key == domain.LoginKeyLinkingUserDoneTitle { wm.LinkingUserDoneTitle = e.Text @@ -2383,25 +2356,6 @@ func (wm *CustomLoginTextReadModel) handleLinkingUserDoneScreenSetEvent(e *polic } } -func (wm *CustomLoginTextReadModel) handleLinkingUserPromptRemoveEvent(e *policy.CustomTextRemovedEvent) { - if e.Key == domain.LoginKeyLinkingUserPromptTitle { - wm.LinkingUserPromptTitle = "" - return - } - if e.Key == domain.LoginKeyLinkingUserPromptDescription { - wm.LinkingUserPromptDescription = "" - return - } - if e.Key == domain.LoginKeyLinkingUserPromptLinkButtonText { - wm.LinkingUserPromptLinkButtonText = "" - return - } - if e.Key == domain.LoginKeyLinkingUserPromptOtherButtonText { - wm.LinkingUserPromptOtherButtonText = "" - return - } -} - func (wm *CustomLoginTextReadModel) handleLinkingUserDoneRemoveEvent(e *policy.CustomTextRemovedEvent) { if e.Key == domain.LoginKeyLinkingUserDoneTitle { wm.LinkingUserDoneTitle = "" diff --git a/internal/command/instance_custom_login_text_test.go b/internal/command/instance_custom_login_text_test.go index 9e460a2f7..0822cd2bd 100644 --- a/internal/command/instance_custom_login_text_test.go +++ b/internal/command/instance_custom_login_text_test.go @@ -678,18 +678,6 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) { instance.NewCustomTextSetEvent(context.Background(), &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgSaveButtonText, "SaveButtonText", language.English, ), - instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptTitle, "Title", language.English, - ), - instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptDescription, "Description", language.English, - ), - instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptLinkButtonText, "LinkButtonText", language.English, - ), - instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptOtherButtonText, "OtherButtonText", language.English, - ), instance.NewCustomTextSetEvent(context.Background(), &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneTitle, "Title", language.English, ), @@ -1024,12 +1012,6 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) { PrivacyLinkText: "PrivacyLinkText", SaveButtonText: "SaveButtonText", }, - LinkingUserPrompt: domain.LinkingUserPromptScreenText{ - Title: "Title", - Description: "Description", - LinkButtonText: "LinkButtonText", - OtherButtonText: "OtherButtonText", - }, LinkingUsersDone: domain.LinkingUserDoneScreenText{ Title: "Title", Description: "Description", @@ -2260,30 +2242,6 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) { &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgSaveButtonText, "SaveButtonText", language.English, ), ), - eventFromEventPusherWithInstanceID( - "INSTANCE", - instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptTitle, "Title", language.English, - ), - ), - eventFromEventPusherWithInstanceID( - "INSTANCE", - instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptDescription, "Description", language.English, - ), - ), - eventFromEventPusherWithInstanceID( - "INSTANCE", - instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptLinkButtonText, "LinkButtonText", language.English, - ), - ), - eventFromEventPusherWithInstanceID( - "INSTANCE", - instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptOtherButtonText, "OtherButtonText", language.English, - ), - ), eventFromEventPusherWithInstanceID( "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), @@ -3021,18 +2979,6 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) { instance.NewCustomTextRemovedEvent(context.Background(), &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgSaveButtonText, language.English, ), - instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptTitle, language.English, - ), - instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptDescription, language.English, - ), - instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptLinkButtonText, language.English, - ), - instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptOtherButtonText, language.English, - ), instance.NewCustomTextRemovedEvent(context.Background(), &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneTitle, language.English, ), @@ -3141,7 +3087,6 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) { RegistrationUser: domain.RegistrationUserScreenText{}, ExternalRegistrationUserOverview: domain.ExternalRegistrationUserOverviewScreenText{}, RegistrationOrg: domain.RegistrationOrgScreenText{}, - LinkingUserPrompt: domain.LinkingUserPromptScreenText{}, LinkingUsersDone: domain.LinkingUserDoneScreenText{}, ExternalNotFound: domain.ExternalUserNotFoundScreenText{}, LoginSuccess: domain.SuccessLoginScreenText{}, @@ -4344,30 +4289,6 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) { &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgSaveButtonText, "SaveButtonText", language.English, ), ), - eventFromEventPusherWithInstanceID( - "INSTANCE", - instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptTitle, "Title", language.English, - ), - ), - eventFromEventPusherWithInstanceID( - "INSTANCE", - instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptDescription, "Description", language.English, - ), - ), - eventFromEventPusherWithInstanceID( - "INSTANCE", - instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptLinkButtonText, "LinkButtonText", language.English, - ), - ), - eventFromEventPusherWithInstanceID( - "INSTANCE", - instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptOtherButtonText, "OtherButtonText", language.English, - ), - ), eventFromEventPusherWithInstanceID( "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), @@ -5695,30 +5616,6 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) { &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgSaveButtonText, language.English, ), ), - eventFromEventPusherWithInstanceID( - "INSTANCE", - instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptTitle, language.English, - ), - ), - eventFromEventPusherWithInstanceID( - "INSTANCE", - instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptDescription, language.English, - ), - ), - eventFromEventPusherWithInstanceID( - "INSTANCE", - instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptLinkButtonText, language.English, - ), - ), - eventFromEventPusherWithInstanceID( - "INSTANCE", - instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptOtherButtonText, language.English, - ), - ), eventFromEventPusherWithInstanceID( "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), @@ -6456,18 +6353,6 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) { instance.NewCustomTextSetEvent(context.Background(), &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgSaveButtonText, "SaveButtonText", language.English, ), - instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptTitle, "Title", language.English, - ), - instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptDescription, "Description", language.English, - ), - instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptLinkButtonText, "LinkButtonText", language.English, - ), - instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptOtherButtonText, "OtherButtonText", language.English, - ), instance.NewCustomTextSetEvent(context.Background(), &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneTitle, "Title", language.English, ), @@ -6802,12 +6687,6 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) { PrivacyLinkText: "PrivacyLinkText", SaveButtonText: "SaveButtonText", }, - LinkingUserPrompt: domain.LinkingUserPromptScreenText{ - Title: "Title", - Description: "Description", - LinkButtonText: "LinkButtonText", - OtherButtonText: "OtherButtonText", - }, LinkingUsersDone: domain.LinkingUserDoneScreenText{ Title: "Title", Description: "Description", diff --git a/internal/command/org_custom_login_text_test.go b/internal/command/org_custom_login_text_test.go index 0e4be6cee..cc05dae43 100644 --- a/internal/command/org_custom_login_text_test.go +++ b/internal/command/org_custom_login_text_test.go @@ -1087,26 +1087,6 @@ func TestCommandSide_SetCustomOrgLoginText(t *testing.T) { &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgSaveButtonText, "SaveButtonText", language.English, ), ), - eventFromEventPusher( - org.NewCustomTextSetEvent(context.Background(), - &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptTitle, "Title", language.English, - ), - ), - eventFromEventPusher( - org.NewCustomTextSetEvent(context.Background(), - &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptDescription, "Description", language.English, - ), - ), - eventFromEventPusher( - org.NewCustomTextSetEvent(context.Background(), - &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptLinkButtonText, "LinkButtonText", language.English, - ), - ), - eventFromEventPusher( - org.NewCustomTextSetEvent(context.Background(), - &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptOtherButtonText, "OtherButtonText", language.English, - ), - ), eventFromEventPusher( org.NewCustomTextSetEvent(context.Background(), &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneTitle, "Title", language.English, @@ -1489,12 +1469,6 @@ func TestCommandSide_SetCustomOrgLoginText(t *testing.T) { PrivacyLinkText: "PrivacyLinkText", SaveButtonText: "SaveButtonText", }, - LinkingUserPrompt: domain.LinkingUserPromptScreenText{ - Title: "Title", - Description: "Description", - LinkButtonText: "LinkButtonText", - OtherButtonText: "OtherButtonText", - }, LinkingUsersDone: domain.LinkingUserDoneScreenText{ Title: "Title", Description: "Description", @@ -2523,26 +2497,6 @@ func TestCommandSide_SetCustomOrgLoginText(t *testing.T) { &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgSaveButtonText, "SaveButtonText", language.English, ), ), - eventFromEventPusher( - org.NewCustomTextSetEvent(context.Background(), - &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptTitle, "Title", language.English, - ), - ), - eventFromEventPusher( - org.NewCustomTextSetEvent(context.Background(), - &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptDescription, "Description", language.English, - ), - ), - eventFromEventPusher( - org.NewCustomTextSetEvent(context.Background(), - &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptLinkButtonText, "LinkButtonText", language.English, - ), - ), - eventFromEventPusher( - org.NewCustomTextSetEvent(context.Background(), - &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptOtherButtonText, "OtherButtonText", language.English, - ), - ), eventFromEventPusher( org.NewCustomTextSetEvent(context.Background(), &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneTitle, "Title", language.English, @@ -3253,18 +3207,6 @@ func TestCommandSide_SetCustomOrgLoginText(t *testing.T) { org.NewCustomTextRemovedEvent(context.Background(), &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgSaveButtonText, language.English, ), - org.NewCustomTextRemovedEvent(context.Background(), - &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptTitle, language.English, - ), - org.NewCustomTextRemovedEvent(context.Background(), - &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptDescription, language.English, - ), - org.NewCustomTextRemovedEvent(context.Background(), - &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptLinkButtonText, language.English, - ), - org.NewCustomTextRemovedEvent(context.Background(), - &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptOtherButtonText, language.English, - ), org.NewCustomTextRemovedEvent(context.Background(), &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneTitle, language.English, ), @@ -3374,7 +3316,6 @@ func TestCommandSide_SetCustomOrgLoginText(t *testing.T) { ExternalRegistrationUserOverview: domain.ExternalRegistrationUserOverviewScreenText{}, RegistrationUser: domain.RegistrationUserScreenText{}, RegistrationOrg: domain.RegistrationOrgScreenText{}, - LinkingUserPrompt: domain.LinkingUserPromptScreenText{}, LinkingUsersDone: domain.LinkingUserDoneScreenText{}, ExternalNotFound: domain.ExternalUserNotFoundScreenText{}, LoginSuccess: domain.SuccessLoginScreenText{}, @@ -4374,26 +4315,6 @@ func TestCommandSide_SetCustomOrgLoginText(t *testing.T) { &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgSaveButtonText, "SaveButtonText", language.English, ), ), - eventFromEventPusher( - org.NewCustomTextSetEvent(context.Background(), - &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptTitle, "Title", language.English, - ), - ), - eventFromEventPusher( - org.NewCustomTextSetEvent(context.Background(), - &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptDescription, "Description", language.English, - ), - ), - eventFromEventPusher( - org.NewCustomTextSetEvent(context.Background(), - &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptLinkButtonText, "LinkButtonText", language.English, - ), - ), - eventFromEventPusher( - org.NewCustomTextSetEvent(context.Background(), - &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptOtherButtonText, "OtherButtonText", language.English, - ), - ), eventFromEventPusher( org.NewCustomTextSetEvent(context.Background(), &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneTitle, "Title", language.English, @@ -5494,26 +5415,6 @@ func TestCommandSide_SetCustomOrgLoginText(t *testing.T) { &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgSaveButtonText, language.English, ), ), - eventFromEventPusher( - org.NewCustomTextRemovedEvent(context.Background(), - &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptTitle, language.English, - ), - ), - eventFromEventPusher( - org.NewCustomTextRemovedEvent(context.Background(), - &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptDescription, language.English, - ), - ), - eventFromEventPusher( - org.NewCustomTextRemovedEvent(context.Background(), - &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptLinkButtonText, language.English, - ), - ), - eventFromEventPusher( - org.NewCustomTextRemovedEvent(context.Background(), - &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptOtherButtonText, language.English, - ), - ), eventFromEventPusher( org.NewCustomTextRemovedEvent(context.Background(), &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneTitle, language.English, @@ -6224,18 +6125,6 @@ func TestCommandSide_SetCustomOrgLoginText(t *testing.T) { org.NewCustomTextSetEvent(context.Background(), &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgSaveButtonText, "SaveButtonText", language.English, ), - org.NewCustomTextSetEvent(context.Background(), - &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptTitle, "Title", language.English, - ), - org.NewCustomTextSetEvent(context.Background(), - &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptDescription, "Description", language.English, - ), - org.NewCustomTextSetEvent(context.Background(), - &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptLinkButtonText, "LinkButtonText", language.English, - ), - org.NewCustomTextSetEvent(context.Background(), - &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserPromptOtherButtonText, "OtherButtonText", language.English, - ), org.NewCustomTextSetEvent(context.Background(), &org.NewAggregate("org1").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneTitle, "Title", language.English, ), @@ -6570,12 +6459,6 @@ func TestCommandSide_SetCustomOrgLoginText(t *testing.T) { PrivacyLinkText: "PrivacyLinkText", SaveButtonText: "SaveButtonText", }, - LinkingUserPrompt: domain.LinkingUserPromptScreenText{ - Title: "Title", - Description: "Description", - LinkButtonText: "LinkButtonText", - OtherButtonText: "OtherButtonText", - }, LinkingUsersDone: domain.LinkingUserDoneScreenText{ Title: "Title", Description: "Description", diff --git a/internal/domain/custom_login_text.go b/internal/domain/custom_login_text.go index ac53d09b2..66b666dff 100644 --- a/internal/domain/custom_login_text.go +++ b/internal/domain/custom_login_text.go @@ -265,12 +265,6 @@ const ( LoginKeyRegisterOrgSaveButtonText = LoginKeyRegistrationOrg + "SaveButtonText" LoginKeyRegisterOrgBackButtonText = LoginKeyRegistrationOrg + "BackButtonText" - LoginKeyLinkingUserPrompt = "LinkingUserPrompt." - LoginKeyLinkingUserPromptTitle = LoginKeyLinkingUserPrompt + "Title" - LoginKeyLinkingUserPromptDescription = LoginKeyLinkingUserPrompt + "Description" - LoginKeyLinkingUserPromptLinkButtonText = LoginKeyLinkingUserPrompt + "LinkButtonText" - LoginKeyLinkingUserPromptOtherButtonText = LoginKeyLinkingUserPrompt + "OtherButtonText" - LoginKeyLinkingUserDone = "LinkingUsersDone." LoginKeyLinkingUserDoneTitle = LoginKeyLinkingUserDone + "Title" LoginKeyLinkingUserDoneDescription = LoginKeyLinkingUserDone + "Description" @@ -343,7 +337,6 @@ type CustomLoginText struct { RegistrationUser RegistrationUserScreenText ExternalRegistrationUserOverview ExternalRegistrationUserOverviewScreenText RegistrationOrg RegistrationOrgScreenText - LinkingUserPrompt LinkingUserPromptScreenText LinkingUsersDone LinkingUserDoneScreenText ExternalNotFound ExternalUserNotFoundScreenText LoginSuccess SuccessLoginScreenText @@ -616,13 +609,6 @@ type RegistrationOrgScreenText struct { SaveButtonText string } -type LinkingUserPromptScreenText struct { - Title string - Description string - LinkButtonText string - OtherButtonText string -} - type LinkingUserDoneScreenText struct { Title string Description string diff --git a/internal/query/custom_text.go b/internal/query/custom_text.go index 4d766b510..e92c910b6 100644 --- a/internal/query/custom_text.go +++ b/internal/query/custom_text.go @@ -409,9 +409,6 @@ func CustomTextsToLoginDomain(instanceID, aggregateID, lang string, texts *Custo if strings.HasPrefix(text.Key, domain.LoginKeyRegistrationOrg) { registrationOrgKeyToDomain(text, result) } - if strings.HasPrefix(text.Key, domain.LoginKeyLinkingUserPrompt) { - linkingUserPromptKeyToDomain(text, result) - } if strings.HasPrefix(text.Key, domain.LoginKeyLinkingUserDone) { linkingUserDoneKeyToDomain(text, result) } @@ -1106,21 +1103,6 @@ func registrationOrgKeyToDomain(text *CustomText, result *domain.CustomLoginText } } -func linkingUserPromptKeyToDomain(text *CustomText, result *domain.CustomLoginText) { - if text.Key == domain.LoginKeyLinkingUserPromptTitle { - result.LinkingUserPrompt.Title = text.Text - } - if text.Key == domain.LoginKeyLinkingUserPromptDescription { - result.LinkingUserPrompt.Description = text.Text - } - if text.Key == domain.LoginKeyLinkingUserPromptLinkButtonText { - result.LinkingUserPrompt.LinkButtonText = text.Text - } - if text.Key == domain.LoginKeyLinkingUserPromptOtherButtonText { - result.LinkingUserPrompt.OtherButtonText = text.Text - } -} - func linkingUserDoneKeyToDomain(text *CustomText, result *domain.CustomLoginText) { if text.Key == domain.LoginKeyLinkingUserDoneTitle { result.LinkingUsersDone.Title = text.Text diff --git a/proto/zitadel/admin.proto b/proto/zitadel/admin.proto index 9fe6ff643..e6f098c2a 100644 --- a/proto/zitadel/admin.proto +++ b/proto/zitadel/admin.proto @@ -7829,7 +7829,8 @@ message SetCustomLoginTextsRequest { zitadel.text.v1.PasswordlessRegistrationScreenText passwordless_registration_text = 33; zitadel.text.v1.PasswordlessRegistrationDoneScreenText passwordless_registration_done_text = 34; zitadel.text.v1.ExternalRegistrationUserOverviewScreenText external_registration_user_overview_text = 35; - zitadel.text.v1.LinkingUserPromptScreenText linking_user_prompt_text = 36; + // Deprecated: the linking user prompt screen no longer exists + zitadel.text.v1.LinkingUserPromptScreenText linking_user_prompt_text = 36 [deprecated = true]; } message SetCustomLoginTextsResponse { diff --git a/proto/zitadel/management.proto b/proto/zitadel/management.proto index e02e23da6..7b57065a4 100644 --- a/proto/zitadel/management.proto +++ b/proto/zitadel/management.proto @@ -11299,7 +11299,8 @@ message SetCustomLoginTextsRequest { zitadel.text.v1.PasswordlessRegistrationScreenText passwordless_registration_text = 33; zitadel.text.v1.PasswordlessRegistrationDoneScreenText passwordless_registration_done_text = 34; zitadel.text.v1.ExternalRegistrationUserOverviewScreenText external_registration_user_overview_text = 35; - zitadel.text.v1.LinkingUserPromptScreenText linking_user_prompt_text = 36; + // Deprecated: the linking user prompt screen no longer exists + zitadel.text.v1.LinkingUserPromptScreenText linking_user_prompt_text = 36 [deprecated = true]; } message SetCustomLoginTextsResponse { diff --git a/proto/zitadel/text.proto b/proto/zitadel/text.proto index af464bf97..b9174fc44 100644 --- a/proto/zitadel/text.proto +++ b/proto/zitadel/text.proto @@ -92,7 +92,8 @@ message LoginCustomText { PasswordlessRegistrationDoneScreenText passwordless_registration_done_text = 34; ExternalRegistrationUserOverviewScreenText external_registration_user_overview_text = 35; bool is_default = 36; - LinkingUserPromptScreenText linking_user_prompt_text = 37; + // Deprecated: the linking user prompt screen no longer exists + zitadel.text.v1.LinkingUserPromptScreenText linking_user_prompt_text = 37 [deprecated = true]; } message SelectAccountScreenText {