fix(v2): UX polish, spec compliance, type safety, race-condition fixes
- Auto-create WebhookToken for new users (first-user and admin-created), so setup wizard step 3 immediately has a valid secret to display - Setup wizard: load webhook secret on step 3 entry (not only on AWS save), so skipping AWS setup still shows correct webhook info - Admin panel: add Edit modal with username and password change for any user (spec: 'Edit username or password of any user') - Webhook handler: only post 'no config' comment on opened/reopened actions, not on synchronize or closed — prevents spam on sync events - deploy.ts: clear stale abort signal at start of runDeploy so a signal meant to cancel the previous job cannot accidentally abort the new one - routes/auth.ts: fix sameSite cookie case to lowercase 'lax' per TypeScript - Add node-cron type declaration to silence TS7016 for that import - SPEC.md: fix ec2:ImportKeyPair → ec2:CreateKeyPair (code uses CreateKeyPair) - example.env: improve comments, add NODE_ENV, add key generation hints Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { useState } from "react";
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { api } from "../services/api";
|
||||
import { useAuth } from "../hooks/useAuth";
|
||||
@@ -28,6 +28,18 @@ export function SetupWizard() {
|
||||
const [webhookUrl, setWebhookUrl] = useState("");
|
||||
const [webhookSecret, setWebhookSecret] = useState("");
|
||||
|
||||
// Auto-load webhook info whenever we reach step 3 (index 3 = "Your Webhook")
|
||||
useEffect(() => {
|
||||
if (step !== 3) return;
|
||||
if (webhookSecret) return;
|
||||
api.user.getWebhookSecret().then(res => {
|
||||
if (res.ok && res.data) {
|
||||
setWebhookUrl(`${window.location.origin}/webhook/${user?.id}`);
|
||||
setWebhookSecret(res.data.token);
|
||||
}
|
||||
}).catch(() => {});
|
||||
}, [step, user?.id]);
|
||||
|
||||
const next = () => setStep(s => Math.min(s + 1, STEPS.length - 1));
|
||||
const skip = () => navigate("/");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user