fix: handle private labeling on login page without auth request (#2309)

* fix: handle private labeling on login page without auth request

* fix: respect requested org (primary domain scope) for private labeling again
This commit is contained in:
Livio Amstutz 2021-09-02 18:29:42 +02:00 committed by GitHub
parent ec6e1ed467
commit b5a6e25e9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -521,6 +521,9 @@ func (repo *AuthRequestRepo) fillPolicies(ctx context.Context, request *domain.A
privateLabelingOrgID = request.UserOrgID
}
}
if request.RequestedOrgID != "" {
privateLabelingOrgID = request.RequestedOrgID
}
labelPolicy, err := repo.getLabelPolicy(ctx, privateLabelingOrgID)
if err != nil {
return err

View File

@ -426,6 +426,9 @@ func (l *Login) getOrgID(authReq *domain.AuthRequest) string {
func (l *Login) getPrivateLabelingID(authReq *domain.AuthRequest) string {
privateLabelingOrgID := domain.IAMID
if authReq == nil {
return privateLabelingOrgID
}
if authReq.PrivateLabelingSetting != domain.PrivateLabelingSettingUnspecified {
privateLabelingOrgID = authReq.ApplicationResourceOwner
}