add refresh-password route

This commit is contained in:
2026-06-30 21:06:51 +07:00
parent 4d9b73cb34
commit d22ad7cb09
9 changed files with 366 additions and 28 deletions
+12 -2
View File
@@ -28,8 +28,8 @@ func (s *server) Echo(_ context.Context, req *proto.EchoReq) (*proto.EchoRsp, er
return &proto.EchoRsp{Text: req.Text}, nil
}
func (s *server) Signup(ctx context.Context, signupReq *proto.SignupReq) (*proto.SignupRsp, error) {
err := s.usersService.AddUser(ctx, signupReq.Username, signupReq.Email)
func (s *server) Signup(ctx context.Context, req *proto.SignupReq) (*proto.SignupRsp, error) {
err := s.usersService.AddUser(ctx, req.Username, req.Email)
if err != nil {
return &proto.SignupRsp{
Error: err.Error(),
@@ -37,3 +37,13 @@ func (s *server) Signup(ctx context.Context, signupReq *proto.SignupReq) (*proto
}
return &proto.SignupRsp{}, nil
}
func (s *server) RefreshPassword(ctx context.Context, req *proto.RefreshPasswordReq) (*proto.RefreshPasswordRsp, error) {
err := s.usersService.RefreshPassword(ctx, req.Email)
if err != nil {
return &proto.RefreshPasswordRsp{
Error: err.Error(),
}, nil
}
return &proto.RefreshPasswordRsp{}, nil
}