refactor: Remove init_token handling from admin initialization logic and related tests
This commit is contained in:
@@ -26,9 +26,6 @@ export default function SetupPage() {
|
||||
const [error, setError] = useState("");
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
// --- Init-admin mode only ---
|
||||
const [initToken, setInitToken] = useState("");
|
||||
|
||||
// --- Change-password mode only ---
|
||||
const [currentPassword, setCurrentPassword] = useState("");
|
||||
|
||||
@@ -82,7 +79,6 @@ export default function SetupPage() {
|
||||
body: JSON.stringify({
|
||||
email,
|
||||
password: newPassword,
|
||||
init_token: initToken,
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -190,23 +186,6 @@ export default function SetupPage() {
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-col space-y-1">
|
||||
<label htmlFor="initToken" className="text-sm font-medium">
|
||||
Initialization Token
|
||||
</label>
|
||||
<Input
|
||||
id="initToken"
|
||||
type="text"
|
||||
placeholder="Copy from server startup logs"
|
||||
value={initToken}
|
||||
onChange={(e) => setInitToken(e.target.value)}
|
||||
required
|
||||
autoComplete="off"
|
||||
/>
|
||||
<p className="text-muted-foreground text-xs">
|
||||
Find the <code>INIT TOKEN</code> printed in the server startup logs.
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex flex-col space-y-1">
|
||||
<label htmlFor="password" className="text-sm font-medium">
|
||||
Password
|
||||
|
||||
@@ -40,7 +40,6 @@ const AUTH_ERROR_CODES = [
|
||||
"provider_not_found",
|
||||
"not_authenticated",
|
||||
"system_already_initialized",
|
||||
"invalid_init_token",
|
||||
] as const;
|
||||
|
||||
export type AuthErrorCode = (typeof AUTH_ERROR_CODES)[number];
|
||||
|
||||
@@ -322,7 +322,7 @@ export function useThreadStream({
|
||||
useEffect(() => {
|
||||
if (
|
||||
optimisticMessages.length > 0 &&
|
||||
thread.messages.length > prevMsgCountRef.current
|
||||
thread.messages.length > prevMsgCountRef.current + 1
|
||||
) {
|
||||
setOptimisticMessages([]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user