From 1f8f50d50b427b489600d43aea558ee4642597ae Mon Sep 17 00:00:00 2001 From: Leopere Date: Tue, 3 Mar 2026 18:07:57 -0500 Subject: [PATCH] Redirect paid-but-not-activated users from landing to /activate If a logged-in user has a Stripe customer ID but isn't in the customers group yet, they've paid but haven't activated. Send them to /activate instead of showing "No Active Subscription". Made-with: Cursor --- docker/ss-atlas/internal/handlers/subscription.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docker/ss-atlas/internal/handlers/subscription.go b/docker/ss-atlas/internal/handlers/subscription.go index 62f6d23..f18452a 100644 --- a/docker/ss-atlas/internal/handlers/subscription.go +++ b/docker/ss-atlas/internal/handlers/subscription.go @@ -10,10 +10,22 @@ import ( ) func (a *App) handleLanding(w http.ResponseWriter, r *http.Request) { + remoteUser := r.Header.Get("Remote-User") + if contains(r.Header.Get("Remote-Groups"), "customers") { http.Redirect(w, r, a.cfg.AppURL+"/dashboard", http.StatusSeeOther) return } + + // Logged-in user who paid but hasn't activated yet — send to activate. + if remoteUser != "" { + custID, _ := a.ldap.GetStripeCustomerID(remoteUser) + if custID != "" { + http.Redirect(w, r, a.cfg.AppURL+"/activate", http.StatusSeeOther) + return + } + } + data := map[string]any{ "AppURL": a.cfg.AppURL, "Commit": version.Commit,