]> Repos - crimata-website/commitdiff
Remove dashboard, route post-checkout to home
authorAndrew Gundersen <adgundersen@gmail.com>
Mon, 2 Mar 2026 02:57:07 +0000 (21:57 -0500)
committerAndrew Gundersen <adgundersen@gmail.com>
Mon, 2 Mar 2026 02:57:07 +0000 (21:57 -0500)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
app/controllers/application_controller.rb
app/controllers/checkout_controller.rb
app/controllers/dashboard_controller.rb [deleted file]
app/views/dashboard/show.html.erb [deleted file]
app/views/layouts/application.html.erb
config/routes.rb

index 60f1c00029196fb0096d3154d3a2d853056b7ee5..0d093747ec8f3f153a78f6187a72523e5bf4757b 100644 (file)
@@ -15,7 +15,7 @@ class ApplicationController < ActionController::Base
   end
 
   def redirect_after_auth
-    path = session.delete(:return_to) || dashboard_path
+    path = session.delete(:return_to) || root_path
     redirect_to path
   end
 end
index 67ecf9b987d068c6df9a37a325975b1b24254a33..78114c986d34f0c2846d03492287710876235ea4 100644 (file)
@@ -17,7 +17,7 @@ class CheckoutController < ApplicationController
       customer_email: current_customer.email,
       mode:           "subscription",
       line_items:     [{ price: ENV.fetch("STRIPE_PRICE_ID"), quantity: 1 }],
-      success_url:    "#{ENV.fetch("BASE_URL")}/dashboard",
+      success_url:    "#{ENV.fetch("BASE_URL")}/",
       cancel_url:     "#{ENV.fetch("BASE_URL")}/pricing",
       metadata:       { customer_id: current_customer.id }
     )
diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb
deleted file mode 100644 (file)
index 8686295..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-class DashboardController < ApplicationController
-  before_action :require_auth
-
-  def show
-    @customer = current_customer
-  end
-end
diff --git a/app/views/dashboard/show.html.erb b/app/views/dashboard/show.html.erb
deleted file mode 100644 (file)
index e1b0235..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-<% content_for :title, "My Devices — Crimata" %>
-
-<style>
-  .dashboard-header { margin-bottom: 2.5rem; }
-  .dashboard-header h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.5px; }
-  .dashboard-header p { color: #666; margin-top: 0.4rem; font-size: 0.95rem; }
-
-  .devices { display: grid; gap: 1rem; }
-
-  .device-card {
-    border: 1px solid #e5e5e5;
-    border-radius: 12px;
-    padding: 1.5rem;
-    display: flex;
-    align-items: center;
-    gap: 1.25rem;
-    background: #fafafa;
-  }
-  .device-card:hover { border-color: #ccc; background: #fff; }
-
-  .device-icon {
-    width: 52px; height: 52px;
-    background: #111;
-    border-radius: 10px;
-    display: flex; align-items: center; justify-content: center;
-    flex-shrink: 0;
-  }
-  .device-icon svg { width: 28px; height: 28px; fill: #fff; }
-
-  .device-info { flex: 1; min-width: 0; }
-  .device-name { font-weight: 600; font-size: 1rem; margin-bottom: 0.2rem; }
-  .device-meta { font-size: 0.85rem; color: #888; display: flex; gap: 1rem; flex-wrap: wrap; }
-  .device-meta span { display: flex; align-items: center; gap: 0.3rem; }
-
-  .device-status { flex-shrink: 0; }
-  .badge {
-    display: inline-flex; align-items: center; gap: 0.4rem;
-    font-size: 0.78rem; font-weight: 600;
-    padding: 0.3rem 0.75rem;
-    border-radius: 20px;
-  }
-  .badge.provisioning { background: #fff3cd; color: #856404; }
-  .badge.active { background: #d1fae5; color: #065f46; }
-  .badge .dot {
-    width: 6px; height: 6px; border-radius: 50%;
-    background: currentColor;
-  }
-
-  .device-action { flex-shrink: 0; }
-  .device-action a {
-    font-size: 0.85rem; color: #2563eb; text-decoration: none; font-weight: 500;
-  }
-  .device-action a:hover { text-decoration: underline; }
-  .device-action .disabled { color: #bbb; cursor: default; font-size: 0.85rem; }
-
-  .empty-state {
-    text-align: center; padding: 4rem 0; color: #888;
-  }
-  .empty-state h2 { font-size: 1.25rem; font-weight: 600; color: #333; margin-bottom: 0.5rem; }
-
-  .setup-card {
-    border: 1px dashed #e5e5e5;
-    border-radius: 12px;
-    padding: 2rem;
-    text-align: center;
-    color: #888;
-  }
-  .setup-card .spinner {
-    width: 32px; height: 32px;
-    border: 3px solid #eee;
-    border-top-color: #111;
-    border-radius: 50%;
-    animation: spin 0.8s linear infinite;
-    margin: 0 auto 1rem;
-  }
-  @keyframes spin { to { transform: rotate(360deg); } }
-  .setup-card p { font-size: 0.9rem; margin-top: 0.4rem; }
-</style>
-
-<div class="dashboard-header">
-  <h1>My Devices</h1>
-  <p><%= @customer&.email %></p>
-</div>
-
-<div class="devices">
-  <% if @customer.nil? %>
-    <div class="setup-card">
-      <div class="spinner"></div>
-      <strong>Setting up your device&hellip;</strong>
-      <p>This usually takes a minute. Refresh to check progress.</p>
-    </div>
-  <% else %>
-    <div class="device-card">
-      <div class="device-icon">
-        <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
-          <path d="M20 3H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h7v2H8v2h8v-2h-3v-2h7a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1zm-1 12H5V5h14v10z"/>
-        </svg>
-      </div>
-
-      <div class="device-info">
-        <div class="device-name"><%= @customer.slug || "Your device" %></div>
-        <div class="device-meta">
-          <% if @customer.slug.present? %>
-            <span>&#127758; <%= @customer.slug %>.crimata.com</span>
-          <% end %>
-        </div>
-      </div>
-
-      <div class="device-status">
-        <% badge_class = @customer.status == "active" ? "active" : "provisioning" %>
-        <% badge_label = { "active" => "Active", "provisioning" => "Provisioning", "failed" => "Failed" }.fetch(@customer.status, "Pending") %>
-        <span class="badge <%= badge_class %>">
-          <span class="dot"></span><%= badge_label %>
-        </span>
-      </div>
-
-      <div class="device-action">
-        <% if @customer.slug.present? %>
-          <a href="https://<%= @customer.slug %>.crimata.com" target="_blank">Open &rarr;</a>
-        <% else %>
-          <span class="disabled">Not ready yet</span>
-        <% end %>
-      </div>
-    </div>
-  <% end %>
-</div>
index c26c2b2cb8582582cda069e24db4dac8a9d1d512..ff3ba06e7cbb8ff3477871dcdd3bc8f509d4f3e7 100644 (file)
@@ -24,8 +24,7 @@
     <nav>
       <%= link_to "Pricing", pricing_path %>
       <% if current_customer %>
-        <%= link_to "Dashboard", dashboard_path %>
-        <%= link_to "Sign out", logout_path %>
+          <%= link_to "Sign out", logout_path %>
       <% else %>
         <%= link_to "Sign in", login_path %>
       <% end %>
index 2ed4d672c5c793480622e96fbcfc59e37456ca9e..87e5767b2948a4d0db909150c6e630499b17bf7e 100644 (file)
@@ -9,9 +9,6 @@ Rails.application.routes.draw do
   get    "/verify",     to: "sessions#verify",  as: :verify
   get    "/logout",     to: "sessions#destroy", as: :logout
 
-  # Dashboard (requires auth)
-  get "/dashboard", to: "dashboard#show"
-
   # Checkout
   get  "/checkout/start",   to: "checkout#start",   as: :checkout_start
   post "/checkout/webhook", to: "checkout#webhook"