feat(oauth): add user agent and IP logging to registration and login processes

This commit is contained in:
Chang lue Tsen
2025-09-05 09:26:10 -04:00
parent 584067375b
commit 71d32d73bb
3 changed files with 41 additions and 14 deletions
@@ -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,