package api import ( "context" "net/http" ) func (r *Router) verifyCurrentPassword(w http.ResponseWriter, ctx context.Context, password string) bool { if password == "" { writeError(w, http.StatusBadRequest, "password_required", "enter the current account password") return false } if err := r.store.VerifyCurrentPassword(ctx, password); err != nil { writeError(w, http.StatusForbidden, "reauthentication_failed", "current account password is incorrect or account is locked") return false } return true }