mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-07 19:07:40 +00:00
fix: backend bugs (#1453)
* fix: add events to query * fix: add events to query * displayname * change email RO Co-authored-by: fabi <fabienne.gerschwiler@gmail.com>
This commit is contained in:
parent
c970003c82
commit
d5f0c2375a
@ -71,6 +71,6 @@ export ZITADEL_DEFAULT_DOMAIN=localhost
|
|||||||
|
|
||||||
|
|
||||||
#Setup
|
#Setup
|
||||||
export ZITADEL_CONSOLE_RESPONSE_TYPE='ID_TOKEN TOKEN'
|
export ZITADEL_CONSOLE_RESPONSE_TYPE='AUTHORIZATION_CODE'
|
||||||
export ZITADEL_CONSOLE_GRANT_TYPE='IMPLICIT'
|
export ZITADEL_CONSOLE_GRANT_TYPE='CODE'
|
||||||
export ZITADEL_CONSOLE_DEV_MODE=true
|
export ZITADEL_CONSOLE_DEV_MODE=true
|
@ -4,10 +4,11 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/caos/logging"
|
"github.com/caos/logging"
|
||||||
|
"golang.org/x/text/language"
|
||||||
|
|
||||||
"github.com/caos/zitadel/internal/api/grpc/user"
|
"github.com/caos/zitadel/internal/api/grpc/user"
|
||||||
"github.com/caos/zitadel/internal/domain"
|
"github.com/caos/zitadel/internal/domain"
|
||||||
"github.com/caos/zitadel/pkg/grpc/auth"
|
"github.com/caos/zitadel/pkg/grpc/auth"
|
||||||
"golang.org/x/text/language"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func UpdateProfileToDomain(ctx context.Context, profile *auth.UpdateMyProfileRequest) *domain.Profile {
|
func UpdateProfileToDomain(ctx context.Context, profile *auth.UpdateMyProfileRequest) *domain.Profile {
|
||||||
@ -19,6 +20,7 @@ func UpdateProfileToDomain(ctx context.Context, profile *auth.UpdateMyProfileReq
|
|||||||
FirstName: profile.FirstName,
|
FirstName: profile.FirstName,
|
||||||
LastName: profile.LastName,
|
LastName: profile.LastName,
|
||||||
NickName: profile.NickName,
|
NickName: profile.NickName,
|
||||||
|
DisplayName: profile.DisplayName,
|
||||||
PreferredLanguage: lang,
|
PreferredLanguage: lang,
|
||||||
Gender: user.GenderToDomain(profile.Gender),
|
Gender: user.GenderToDomain(profile.Gender),
|
||||||
}
|
}
|
||||||
|
@ -221,7 +221,7 @@ func (s *Server) GetHumanEmail(ctx context.Context, req *mgmt_pb.GetHumanEmailRe
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) UpdateHumanEmail(ctx context.Context, req *mgmt_pb.UpdateHumanEmailRequest) (*mgmt_pb.UpdateHumanEmailResponse, error) {
|
func (s *Server) UpdateHumanEmail(ctx context.Context, req *mgmt_pb.UpdateHumanEmailRequest) (*mgmt_pb.UpdateHumanEmailResponse, error) {
|
||||||
email, err := s.command.ChangeHumanEmail(ctx, UpdateHumanEmailRequestToDomain(req))
|
email, err := s.command.ChangeHumanEmail(ctx, UpdateHumanEmailRequestToDomain(ctx, req))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -91,9 +91,12 @@ func UpdateHumanProfileRequestToDomain(req *mgmt_pb.UpdateHumanProfileRequest) *
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func UpdateHumanEmailRequestToDomain(req *mgmt_pb.UpdateHumanEmailRequest) *domain.Email {
|
func UpdateHumanEmailRequestToDomain(ctx context.Context, req *mgmt_pb.UpdateHumanEmailRequest) *domain.Email {
|
||||||
return &domain.Email{
|
return &domain.Email{
|
||||||
ObjectRoot: models.ObjectRoot{AggregateID: req.UserId},
|
ObjectRoot: models.ObjectRoot{
|
||||||
|
AggregateID: req.UserId,
|
||||||
|
ResourceOwner: authz.GetCtxData(ctx).OrgID,
|
||||||
|
},
|
||||||
EmailAddress: req.Email,
|
EmailAddress: req.Email,
|
||||||
IsEmailVerified: req.IsEmailVerified,
|
IsEmailVerified: req.IsEmailVerified,
|
||||||
}
|
}
|
||||||
|
@ -68,6 +68,8 @@ func (wm *HumanEmailWriteModel) Query() *eventstore.SearchQueryBuilder {
|
|||||||
AggregateIDs(wm.AggregateID).
|
AggregateIDs(wm.AggregateID).
|
||||||
EventTypes(user.HumanAddedType,
|
EventTypes(user.HumanAddedType,
|
||||||
user.HumanRegisteredType,
|
user.HumanRegisteredType,
|
||||||
|
user.HumanInitialCodeAddedType,
|
||||||
|
user.HumanInitializedCheckSucceededType,
|
||||||
user.HumanEmailChangedType,
|
user.HumanEmailChangedType,
|
||||||
user.HumanEmailCodeAddedType,
|
user.HumanEmailCodeAddedType,
|
||||||
user.HumanEmailVerifiedType,
|
user.HumanEmailVerifiedType,
|
||||||
|
@ -101,6 +101,8 @@ func (wm *HumanWriteModel) Query() *eventstore.SearchQueryBuilder {
|
|||||||
ResourceOwner(wm.ResourceOwner).
|
ResourceOwner(wm.ResourceOwner).
|
||||||
EventTypes(user.HumanAddedType,
|
EventTypes(user.HumanAddedType,
|
||||||
user.HumanRegisteredType,
|
user.HumanRegisteredType,
|
||||||
|
user.HumanInitialCodeAddedType,
|
||||||
|
user.HumanInitializedCheckSucceededType,
|
||||||
user.UserUserNameChangedType,
|
user.UserUserNameChangedType,
|
||||||
user.HumanProfileChangedType,
|
user.HumanProfileChangedType,
|
||||||
user.HumanEmailChangedType,
|
user.HumanEmailChangedType,
|
||||||
|
@ -70,6 +70,8 @@ func (wm *HumanPasswordWriteModel) Query() *eventstore.SearchQueryBuilder {
|
|||||||
AggregateIDs(wm.AggregateID).
|
AggregateIDs(wm.AggregateID).
|
||||||
EventTypes(user.HumanAddedType,
|
EventTypes(user.HumanAddedType,
|
||||||
user.HumanRegisteredType,
|
user.HumanRegisteredType,
|
||||||
|
user.HumanInitialCodeAddedType,
|
||||||
|
user.HumanInitializedCheckSucceededType,
|
||||||
user.HumanPasswordChangedType,
|
user.HumanPasswordChangedType,
|
||||||
user.HumanPasswordCodeAddedType,
|
user.HumanPasswordCodeAddedType,
|
||||||
user.HumanEmailVerifiedType,
|
user.HumanEmailVerifiedType,
|
||||||
|
@ -79,6 +79,8 @@ func (wm *HumanPhoneWriteModel) Query() *eventstore.SearchQueryBuilder {
|
|||||||
ResourceOwner(wm.ResourceOwner).
|
ResourceOwner(wm.ResourceOwner).
|
||||||
EventTypes(user.HumanAddedType,
|
EventTypes(user.HumanAddedType,
|
||||||
user.HumanRegisteredType,
|
user.HumanRegisteredType,
|
||||||
|
user.HumanInitialCodeAddedType,
|
||||||
|
user.HumanInitializedCheckSucceededType,
|
||||||
user.HumanPhoneChangedType,
|
user.HumanPhoneChangedType,
|
||||||
user.HumanPhoneVerifiedType,
|
user.HumanPhoneVerifiedType,
|
||||||
user.HumanPhoneCodeAddedType,
|
user.HumanPhoneCodeAddedType,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user