Remove dashboard, route post-checkout to home

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Andrew Gundersen 2026-03-01 21:57:07 -05:00
commit 008524db1b
6 changed files with 3 additions and 140 deletions

View 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

View 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 }
)

View file

@ -1,7 +0,0 @@
class DashboardController < ApplicationController
before_action :require_auth
def show
@customer = current_customer
end
end

View file

@ -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>

View 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 %>

View 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"