feat(oauth): add user agent and IP logging to registration and login processes
This commit is contained in:
@@ -25,6 +25,7 @@ func TelephoneUserRegisterHandler(svcCtx *svc.ServiceContext) func(c *gin.Contex
|
||||
}
|
||||
// get client ip
|
||||
req.IP = c.ClientIP()
|
||||
req.UserAgent = c.Request.UserAgent()
|
||||
if svcCtx.Config.Verify.RegisterVerify {
|
||||
verifyTurns := turnstile.New(turnstile.Config{
|
||||
Secret: svcCtx.Config.Verify.TurnstileSecret,
|
||||
|
||||
@@ -20,6 +20,7 @@ func UserRegisterHandler(svcCtx *svc.ServiceContext) func(c *gin.Context) {
|
||||
_ = c.ShouldBind(&req)
|
||||
// get client ip
|
||||
req.IP = c.ClientIP()
|
||||
req.UserAgent = c.Request.UserAgent()
|
||||
if svcCtx.Config.Verify.RegisterVerify {
|
||||
verifyTurns := turnstile.New(turnstile.Config{
|
||||
Secret: svcCtx.Config.Verify.TurnstileSecret,
|
||||
|
||||
Reference in New Issue
Block a user