fix: idps (#777)

* fix: update client secret, skip passwordsteps only if login not if linking

* fix: global policy for register

* fix: scope handling

* fix: back after error

* fix: change org id scope to primary domain

* fix: check if primarydomain empty

* fix: local sh

* fix: disable buttons on org login policy
This commit is contained in:
Fabi
2020-09-28 09:29:41 +02:00
committed by GitHub
parent 3e1204524e
commit 83b0ac1fdb
17 changed files with 196 additions and 55 deletions
+11 -3
View File
@@ -71,9 +71,17 @@ func (l *Login) handleRegisterCheck(w http.ResponseWriter, r *http.Request) {
ObjectRoot: models.ObjectRoot{AggregateID: iam.GlobalOrgID},
Roles: []string{orgProjectCreatorRole},
}
if authRequest.GetScopeOrgID() != "" && authRequest.GetScopeOrgID() != iam.GlobalOrgID {
member = nil
resourceOwner = authRequest.GetScopeOrgID()
if authRequest.GetScopeOrgPrimaryDomain() != "" {
primaryDomain := authRequest.GetScopeOrgPrimaryDomain()
org, err := l.authRepo.GetOrgByPrimaryDomain(primaryDomain)
if err != nil {
l.renderRegisterOption(w, r, authRequest, err)
return
}
if org.ID != iam.GlobalOrgID {
member = nil
resourceOwner = org.ID
}
}
user, err := l.authRepo.Register(setContext(r.Context(), resourceOwner), data.toUserModel(), member, resourceOwner)
if err != nil {