Skip to content

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

format

Uku Tahtb7dcbb5e5478
diff --git a/lib/plausible_web/controllers/auth_controller.ex b/lib/plausible_web/controllers/auth_controller.ex
index 56e7c1e978..1a9556bcca 100644
--- a/lib/plausible_web/controllers/auth_controller.ex
+++ b/lib/plausible_web/controllers/auth_controller.ex
@@ -156,11 +156,13 @@ defmodule PlausibleWeb.AuthController do
def activate(conn, %{"code" => code}) do
user = conn.assigns[:current_user]
+
has_invitation =
Repo.exists?(
from i in Plausible.Auth.Invitation,
where: i.email == ^user.email
)
+
{code, ""} = Integer.parse(code)
case Auth.verify_email(user, code) do