mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-20 20:08:46 +00:00
feat: set private labeling setting on project (#2184)
* docs: add scope to request private labeling * feat: add enum to project * fix: remove unused code, add private labeling setting to query side * fix: set private labeling depending on setting * fix: private labeling depending on project setting * Update proto/zitadel/management.proto Co-authored-by: Livio Amstutz <[email protected]> * fix: rename sql file * fix: private labeling setting Co-authored-by: Livio Amstutz <[email protected]>
This commit is contained in:
@@ -329,6 +329,7 @@ func (l *Login) getBaseData(r *http.Request, authReq *domain.AuthRequest, title
|
||||
Theme: l.getTheme(r),
|
||||
ThemeMode: l.getThemeMode(r),
|
||||
DarkMode: l.isDarkMode(r),
|
||||
PrivateLabelingOrgID: l.getPrivateLabelingID(authReq),
|
||||
OrgID: l.getOrgID(authReq),
|
||||
OrgName: l.getOrgName(authReq),
|
||||
PrimaryDomain: l.getOrgPrimaryDomain(authReq),
|
||||
@@ -423,6 +424,19 @@ func (l *Login) getOrgID(authReq *domain.AuthRequest) string {
|
||||
return authReq.UserOrgID
|
||||
}
|
||||
|
||||
func (l *Login) getPrivateLabelingID(authReq *domain.AuthRequest) string {
|
||||
privateLabelingOrgID := domain.IAMID
|
||||
if authReq.PrivateLabelingSetting != domain.PrivateLabelingSettingUnspecified {
|
||||
privateLabelingOrgID = authReq.ApplicationResourceOwner
|
||||
}
|
||||
if authReq.PrivateLabelingSetting == domain.PrivateLabelingSettingAllowLoginUserResourceOwnerPolicy || authReq.PrivateLabelingSetting == domain.PrivateLabelingSettingUnspecified {
|
||||
if authReq.UserOrgID != "" {
|
||||
privateLabelingOrgID = authReq.UserOrgID
|
||||
}
|
||||
}
|
||||
return privateLabelingOrgID
|
||||
}
|
||||
|
||||
func (l *Login) getOrgName(authReq *domain.AuthRequest) string {
|
||||
if authReq == nil {
|
||||
return ""
|
||||
@@ -485,6 +499,7 @@ type baseData struct {
|
||||
Theme string
|
||||
ThemeMode string
|
||||
DarkMode bool
|
||||
PrivateLabelingOrgID string
|
||||
OrgID string
|
||||
OrgName string
|
||||
PrimaryDomain string
|
||||
|
||||
Reference in New Issue
Block a user