mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 19:44:21 +00:00
21 lines
622 B
Go
21 lines
622 B
Go
|
package auth
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"github.com/caos/zitadel/internal/api/grpc/object"
|
||
|
|
||
|
"github.com/caos/zitadel/internal/api/authz"
|
||
|
auth_pb "github.com/caos/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.OrgID, ctxData.UserID, req.OldPassword, req.NewPassword, "")
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return &auth_pb.UpdateMyPasswordResponse{
|
||
|
Details: object.DomainToDetailsPb(objectDetails),
|
||
|
}, nil
|
||
|
}
|