Skip to content

Commit

Permalink
fix: reset password
Browse files Browse the repository at this point in the history
Signed-off-by: MicroOps-cn <[email protected]>
  • Loading branch information
MicroOps-cn committed Feb 8, 2025
1 parent 86d4a4f commit 965b30a
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 100 deletions.
2 changes: 1 addition & 1 deletion api/endpoints/users.proto
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ message PatchUserRequest{
message ResetUserPasswordRequest{
string token = 1[(gogoproto.customtype) = "github.com/MicroOps-cn/idas/pkg/service/models.Secret"];
string old_password = 2[(gogoproto.customtype) = "github.com/MicroOps-cn/idas/pkg/service/models.Secret", (gogoproto.jsontag) = "oldPassword,omitempty"];
string user_id = 3[(gogoproto.jsontag) = "userId", (gogoproto.moretags) = 'valid:"optional,uuid"'];
string user_id = 3[(gogoproto.jsontag) = "userId,omitempty", (gogoproto.moretags) = 'valid:"optional,uuid"'];
string new_password = 5[(gogoproto.customtype) = "github.com/MicroOps-cn/idas/pkg/service/models.Secret", (gogoproto.jsontag) = "newPassword", (gogoproto.moretags) = 'valid:"required"'];
string username = 6[(gogoproto.moretags) = 'valid:"optional,matches(^[-_A-Za-z0-9]+$)"'];
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/endpoint/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ func MakeResetUserPasswordEndpoint(s service.Service) endpoint.Endpoint {
} else {
return nil, errors.UnauthorizedError()
}
} else {
return nil, errors.LackParameterError("username")
}
} else {
return nil, errors.LackParameterError("token,id")
Expand Down
Loading

0 comments on commit 965b30a

Please sign in to comment.