Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

fixup! Refresh Google Analytics token before import (#2254) (#2273)

Vinicius Brasil52b4ee628782
diff --git a/lib/plausible/google/api.ex b/lib/plausible/google/api.ex
index 7878bc53f6..f0c91ccfb7 100644
--- a/lib/plausible/google/api.ex
+++ b/lib/plausible/google/api.ex
@@ -239,7 +239,7 @@ defmodule Plausible.Google.Api do
defp do_refresh_token(refresh_token) do
case 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.ex
index 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 do
email: 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
})