fix: further coderabbit suggestions

This commit is contained in:
Stavros
2025-08-26 14:49:55 +03:00
parent a5e1ae096b
commit a1b6ecdd5d
9 changed files with 33 additions and 18 deletions

View File

@@ -49,7 +49,7 @@ func (controller *UserController) SetupRoutes() {
func (controller *UserController) loginHandler(c *gin.Context) {
var req LoginRequest
err := c.BindJSON(&req)
err := c.ShouldBindJSON(&req)
if err != nil {
log.Error().Err(err).Msg("Failed to bind JSON")
c.JSON(400, gin.H{
@@ -174,7 +174,7 @@ func (controller *UserController) logoutHandler(c *gin.Context) {
func (controller *UserController) totpHandler(c *gin.Context) {
var req TotpRequest
err := c.BindJSON(&req)
err := c.ShouldBindJSON(&req)
if err != nil {
log.Error().Err(err).Msg("Failed to bind JSON")
c.JSON(400, gin.H{