mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 04:07:31 +00:00
fix: backend fixes (#1452)
* fix: email change not possible if init state * fix: email change not possible if init state * passwordless Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"github.com/caos/zitadel/internal/api/grpc/object"
|
||||
user_grpc "github.com/caos/zitadel/internal/api/grpc/user"
|
||||
auth_pb "github.com/caos/zitadel/pkg/grpc/auth"
|
||||
user_pb "github.com/caos/zitadel/pkg/grpc/user"
|
||||
)
|
||||
|
||||
func (s *Server) ListMyPasswordless(ctx context.Context, _ *auth_pb.ListMyPasswordlessRequest) (*auth_pb.ListMyPasswordlessResponse, error) {
|
||||
@@ -21,16 +22,18 @@ func (s *Server) ListMyPasswordless(ctx context.Context, _ *auth_pb.ListMyPasswo
|
||||
|
||||
func (s *Server) AddMyPasswordless(ctx context.Context, _ *auth_pb.AddMyPasswordlessRequest) (*auth_pb.AddMyPasswordlessResponse, error) {
|
||||
ctxData := authz.GetCtxData(ctx)
|
||||
u2f, err := s.command.HumanAddPasswordlessSetup(ctx, ctxData.UserID, ctxData.ResourceOwner, false)
|
||||
token, err := s.command.HumanAddPasswordlessSetup(ctx, ctxData.UserID, ctxData.ResourceOwner, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &auth_pb.AddMyPasswordlessResponse{
|
||||
Key: user_grpc.WebAuthNTokenToWebAuthNKeyPb(u2f),
|
||||
Key: &user_pb.WebAuthNKey{
|
||||
PublicKey: token.CredentialCreationData,
|
||||
},
|
||||
Details: object.AddToDetailsPb(
|
||||
u2f.Sequence,
|
||||
u2f.ChangeDate,
|
||||
u2f.ResourceOwner,
|
||||
token.Sequence,
|
||||
token.ChangeDate,
|
||||
token.ResourceOwner,
|
||||
),
|
||||
}, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user