✨ Captcha Gateway
This commit is contained in:
14
pkg/internal/grpc/captcha.go
Normal file
14
pkg/internal/grpc/captcha.go
Normal file
@@ -0,0 +1,14 @@
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user