Nexus/pkg/internal/grpc/captcha.go
2025-03-22 19:48:19 +08:00

15 lines
360 B
Go

package grpc
import (
"context"
"git.solsynth.dev/hypernet/nexus/pkg/internal/captcha"
"git.solsynth.dev/hypernet/nexus/pkg/proto"
)
func (v *Server) CheckCaptcha(_ context.Context, req *proto.CheckCaptchaRequest) (*proto.CheckCaptchaResponse, error) {
return &proto.CheckCaptchaResponse{
IsValid: captcha.Validate(req.Token, req.RemoteIp),
}, nil
}