     ) |> Repo.update!
     Logger.info("last_refreshed_at for login #{login.saltedge_login_id} has been updated")
   end
-
 
   defp set_user(conn, _opts) do
     case conn.params["data"]["customer_id"] do

          last_fail_message: params["data"]["message"]
        })
        if changeset.valid? do
          case Repo.update(changeset) do
            {:ok, _login} ->
              put_resp_content_type(conn, "application/json")
              |> send_resp(200, "ok")
            {:error, changeset} ->
              # log error
              Logger.info("Could not create Login for customer_id => #{inspect(customer_id)}, errors => #{inspect(changeset.errors)}")
              put_resp_content_type(conn, "application/json")
              |> send_resp(200, "ok")

      [{_key, value}] -> value
    end
  end

  defp otp_done(user_id) do
    user_id = "user:#{user_id}"
    key = "ongoing_interactive_#{user_id}"
    :ets.update_element(:ex_money_cache, key, {2, false})
  end
end
