mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-15 20:38:00 +00:00
fa9f581d56
* chore: move to new org * logging * fix: org rename caos -> zitadel Co-authored-by: adlerhurst <silvan.reusser@gmail.com>
22 lines
646 B
Go
22 lines
646 B
Go
package auth
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/zitadel/zitadel/internal/api/grpc/object"
|
|
|
|
"github.com/zitadel/zitadel/internal/api/authz"
|
|
auth_pb "github.com/zitadel/zitadel/pkg/grpc/auth"
|
|
)
|
|
|
|
func (s *Server) UpdateMyPassword(ctx context.Context, req *auth_pb.UpdateMyPasswordRequest) (*auth_pb.UpdateMyPasswordResponse, error) {
|
|
ctxData := authz.GetCtxData(ctx)
|
|
objectDetails, err := s.command.ChangePassword(ctx, ctxData.ResourceOwner, ctxData.UserID, req.OldPassword, req.NewPassword, "")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &auth_pb.UpdateMyPasswordResponse{
|
|
Details: object.DomainToChangeDetailsPb(objectDetails),
|
|
}, nil
|
|
}
|