diff --git a/internal/http/middleware/auth.go b/internal/http/middleware/auth.go index 7e0e7f3b1..642317933 100644 --- a/internal/http/middleware/auth.go +++ b/internal/http/middleware/auth.go @@ -21,7 +21,7 @@ func AuthMiddleware(deps *dependencies.Dependencies) gin.HandlerFunc { token = getTokenFromCookie(c) } - account, err := deps.Domains.Auth.CheckToken(c, token) + account, err := deps.Domains.Auth.CheckToken(c.Request.Context(), token) if err != nil { deps.Log.WithError(err).Error("Failed to check token") return diff --git a/internal/http/routes/api/v1/auth.go b/internal/http/routes/api/v1/auth.go index d34405b0a..0bfeaf423 100644 --- a/internal/http/routes/api/v1/auth.go +++ b/internal/http/routes/api/v1/auth.go @@ -211,7 +211,7 @@ func (r *AuthAPIRoutes) updateHandler(c *gin.Context) { // If trying to update password, check if old password is correct if payload.NewPassword != "" { - _, err := r.deps.Domains.Auth.GetAccountFromCredentials(c, account.Username, payload.OldPassword) + _, err := r.deps.Domains.Auth.GetAccountFromCredentials(c.Request.Context(), account.Username, payload.OldPassword) if err != nil { response.SendError(c, http.StatusBadRequest, "Old password is incorrect") return @@ -221,7 +221,7 @@ func (r *AuthAPIRoutes) updateHandler(c *gin.Context) { updatedAccount := payload.ToAccountDTO() updatedAccount.ID = account.ID - account, err := r.deps.Domains.Accounts.UpdateAccount(c, updatedAccount) + account, err := r.deps.Domains.Accounts.UpdateAccount(c.Request.Context(), updatedAccount) if err != nil { r.deps.Log.WithError(err).Error("failed to update account") response.SendInternalServerError(c)