generated from VLADIMIR/template
add refresh-password route
This commit is contained in:
+12
-2
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user