Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
fixup! Refresh Google Analytics token before import (#2254) (#2273)
Vinicius Brasil52b4ee628782
diff --git a/lib/plausible/google/api.ex b/lib/plausible/google/api.exindex 7878bc53f6..f0c91ccfb7 100644--- a/lib/plausible/google/api.ex+++ b/lib/plausible/google/api.ex@@ -239,7 +239,7 @@ defmodule Plausible.Google.Api dodefp do_refresh_token(refresh_token) docase HTTP.refresh_auth_token(refresh_token) do- {:ok, %{"access_token" => new_access_token, "expires_at" => expires_in}} ->+ {:ok, %{"access_token" => new_access_token, "expires_in" => expires_in}} ->expires_at = NaiveDateTime.add(NaiveDateTime.utc_now(), expires_in){:ok, {new_access_token, expires_at}}diff --git a/lib/plausible_web/controllers/auth_controller.ex b/lib/plausible_web/controllers/auth_controller.exindex 0dd6bfa429..c6e55b8af6 100644--- a/lib/plausible_web/controllers/auth_controller.ex+++ b/lib/plausible_web/controllers/auth_controller.ex@@ -568,7 +568,7 @@ defmodule PlausibleWeb.AuthController doemail: id["email"],refresh_token: res["refresh_token"],access_token: res["access_token"],- expires_at: expires_at,+ expires: expires_at,user_id: conn.assigns[:current_user].id,site_id: site_id})