mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-22 21:08:47 +00:00
feat(idp): provide option to auto link user (#7734)
* init auto linking * prompt handling * working * translations * console * fixes * unify * custom texts * fix tests * linting * fix check of existing user * fix bg translation * set unspecified as default in the form
This commit is contained in:
@@ -262,6 +262,11 @@ type CustomLoginTextReadModel struct {
|
||||
RegisterOrgPrivacyLinkText string
|
||||
RegisterOrgSaveButtonText string
|
||||
|
||||
LinkingUserPromptTitle string
|
||||
LinkingUserPromptDescription string
|
||||
LinkingUserPromptLinkButtonText string
|
||||
LinkingUserPromptOtherButtonText string
|
||||
|
||||
LinkingUserDoneTitle string
|
||||
LinkingUserDoneDescription string
|
||||
LinkingUserDoneCancelButtonText string
|
||||
@@ -416,6 +421,10 @@ 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
|
||||
@@ -556,6 +565,10 @@ 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
|
||||
@@ -2323,6 +2336,25 @@ 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
|
||||
@@ -2342,6 +2374,25 @@ 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 = ""
|
||||
|
||||
Reference in New Issue
Block a user