
Samuel VolinandMatt Vollmer
f44a3b59d7
feat: Premium Page CTA updates and form handling (#28226)
* Premium page has form for signing up for a trial
* Input validation and normalization for trial form fields
* api endpoint definition to make this processes seamless
* license page updates to access `?success=true` queryparam and confetti
<img width="1512" height="833" alt="Screenshot 2026-08-17 at 10 08
41 PM"
src="https://github.com/user-attachments/assets/1766e724-c63a-4da9-b2bd-a98e6b66cc9b"
/>
<img width="1510" height="874" alt="Aug-17-2026 22-12-38"
src="https://github.com/user-attachments/assets/3a2a0f35-1176-4290-aa0d-b3f7d66c15d6"
/>
```mermaid
sequenceDiagram
autonumber
actor Owner
participant UI as UI<br/>TrialRequestForm + PremiumPage
participant API as API<br/>api.ts + coderd middleware
participant Coderd as Coderd<br/>postTrialLicense + trialer
participant Licensor as Licensor<br/>v2-licensor + Postgres + pubsub + cache
Note over UI: mutation.status = "idle"
Owner->>UI: fills 10 fields, checks acknowledgement
UI->>UI: Yup validate, strip "acknowledged", submit
UI->>API: POST /api/v2/licenses/trial<br/>cookie + X-CSRF-TOKEN
Note over UI: mutation.status = "pending"
API->>API: verify CSRF, apiRateLimiter,<br/>apiKeyMiddleware sets actor
API->>Coderd: dispatch
Coderd->>Coderd: audit.InitRequest, authorize license:create,<br/>httpapi.Read validates, HasLicense is false
Coderd->>Licensor: POST trial request<br/>deployment_id unspoofable, 10s deadline
Licensor-->>Coderd: 200, raw signed JWT
Coderd->>Coderd: ParseClaimsIgnoreNbf, uuid.Parse
Coderd->>Licensor: InsertLicense, updateEntitlements,<br/>publish PubsubEventLicense, commit audit log
Licensor-->>Coderd: database.License
Coderd-->>API: 201 codersdk.License
API-->>UI: 201 codersdk.License
Note over UI: mutation.status = "success"
UI->>Licensor: invalidate entitlements + licenses keys
UI->>Owner: navigate /deployment/premium?success=true
Note over Owner: confetti fires on the success param
```
---------
Co-authored-by: Matt Vollmer <matthewjvollmer@outlook.com>
2026-08-21 09:54:54 -04:00
..
2026-08-21 03:14:55 +03:00
2026-06-26 18:27:37 +02:00
2026-08-05 13:22:23 -07:00
2026-08-17 14:09:23 -08:00
2026-08-20 12:07:30 +02:00
2026-08-20 11:56:14 +01:00
2026-01-08 15:24:11 +04:00
2026-07-28 13:59:37 +02:00
2026-08-05 13:22:23 -07:00
2026-08-05 13:22:23 -07:00
2026-08-05 13:22:23 -07:00
2026-08-20 11:56:58 +01:00
2026-08-04 15:21:23 -04:00
2026-08-04 15:21:23 -04:00
2026-08-05 13:22:23 -07:00
2026-08-05 13:22:23 -07:00
2026-08-19 19:25:18 +00:00
2026-08-05 13:22:23 -07:00
2026-08-21 02:22:18 +03:00
2026-08-21 02:22:18 +03:00
2026-08-21 02:22:18 +03:00
2026-08-19 19:11:52 +00:00
2026-08-05 13:22:23 -07:00
2026-08-04 12:27:38 +02:00
2026-08-20 16:36:57 +02:00
2026-08-06 08:03:47 -07:00
2026-08-06 08:03:47 -07:00
2026-08-18 18:21:50 -05:00
2026-03-13 14:09:39 +00:00
2026-04-01 13:05:14 +00:00
2026-08-18 12:07:22 +07:00
2026-08-19 14:46:10 -05:00
2026-05-19 09:47:03 -05:00
2026-05-19 09:47:03 -05:00
2026-08-05 13:22:23 -07:00
2026-08-05 13:22:23 -07:00
2026-08-05 13:22:23 -07:00
2026-08-10 13:23:14 -07:00
2026-08-05 13:22:23 -07:00
2026-08-05 13:22:23 -07:00
2026-08-05 13:22:23 -07:00
2026-08-18 12:40:33 +07:00
2026-08-21 09:54:54 -04:00
2026-08-19 19:25:18 +00:00
2026-01-09 15:40:26 -07:00
2026-08-05 13:22:23 -07:00
2026-08-18 21:12:44 -07:00
2026-08-18 21:12:44 -07:00
2026-08-20 12:49:47 -07:00
2026-08-06 14:14:37 +10:00
2026-05-22 20:24:38 +10:00
2026-05-21 09:19:29 -06:00
2026-08-05 13:22:23 -07:00
2026-08-05 13:22:23 -07:00
2026-08-19 08:51:25 -05:00
2026-08-19 08:51:25 -05:00
2026-08-11 11:04:51 -05:00
2026-08-19 19:25:18 +00:00
2026-06-05 10:30:31 -05:00
2026-08-05 13:22:23 -07:00
2026-08-05 13:22:23 -07:00
2026-08-05 13:22:23 -07:00
2026-08-05 13:22:23 -07:00
2026-08-06 14:14:37 +10:00
2026-01-08 15:24:11 +04:00
2026-08-05 13:22:23 -07:00
2026-08-05 13:22:23 -07:00
2026-08-05 13:22:23 -07:00
2026-08-05 13:22:23 -07:00
2026-07-28 09:58:33 -06:00
2026-07-28 09:58:33 -06:00
2026-07-28 09:58:33 -06:00
2026-07-28 09:58:33 -06:00
2026-08-05 13:22:23 -07:00
2026-08-05 13:22:23 -07:00
2026-02-06 15:52:54 +00:00
2026-08-10 08:13:32 -05:00
2026-08-05 13:22:23 -07:00
2026-08-05 13:22:23 -07:00
2026-06-26 09:48:05 -07:00
2026-06-08 15:11:36 +01:00
2026-08-10 08:13:32 -05:00
2026-08-05 13:22:23 -07:00