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
fix assign
Uku Tahtd5e79a208349
diff --git a/lib/plausible_web/controllers/auth_controller.ex b/lib/plausible_web/controllers/auth_controller.exindex de2b5d57b4..56e7c1e978 100644--- a/lib/plausible_web/controllers/auth_controller.ex+++ b/lib/plausible_web/controllers/auth_controller.ex@@ -156,12 +156,16 @@ defmodule PlausibleWeb.AuthController dodef activate(conn, %{"code" => code}) douser = conn.assigns[:current_user]- invitation = Repo.get_by(Plausible.Auth.Invitation, email: user.email)+ 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:ok ->- if invitation do+ if has_invitation doredirect(conn, to: "/sites")elseredirect(conn, to: "/sites/new")@@ -171,7 +175,7 @@ defmodule PlausibleWeb.AuthController dorender(conn, "activate.html",error: "Incorrect activation code",has_pin: true,- invitation: invitation,+ has_invitation: has_invitation,layout: {PlausibleWeb.LayoutView, "focus.html"})@@ -179,7 +183,7 @@ defmodule PlausibleWeb.AuthController dorender(conn, "activate.html",error: "Code is expired, please request another one",has_pin: false,- invitation: invitation,+ has_invitation: has_invitation,layout: {PlausibleWeb.LayoutView, "focus.html"})end