From de7e006e579046bed1ac608b59523ddf5ad80ca6 Mon Sep 17 00:00:00 2001 From: tianma-if Date: Thu, 17 Sep 2026 21:32:59 +0800 Subject: [PATCH] fix(desktop): accept instance hosts without an https prefix --- apps/web/src/components/LoginScreen.tsx | 9 ++++++--- apps/web/src/lib/api.test.mjs | 21 ++++++++++++++++++++- apps/web/src/lib/api.ts | 4 ++-- packages/shared/src/i18n/en-US.ts | 2 +- packages/shared/src/i18n/ja.ts | 2 +- packages/shared/src/i18n/zh-CN.ts | 2 +- packages/shared/src/public-demo.test.mjs | 12 +++++++++++- packages/shared/src/public-demo.ts | 10 ++++++++++ tests/login-screen-style.test.ts | 6 ++++++ 9 files changed, 58 insertions(+), 10 deletions(-) diff --git a/apps/web/src/components/LoginScreen.tsx b/apps/web/src/components/LoginScreen.tsx index a2732be7..ddd650af 100644 --- a/apps/web/src/components/LoginScreen.tsx +++ b/apps/web/src/components/LoginScreen.tsx @@ -1,7 +1,7 @@ import { useState, type FormEvent } from "react"; import { LockKeyhole } from "lucide-react"; import { useTranslation } from "react-i18next"; -import { resolveInstanceUrlInput } from "@edgeever/shared"; +import { normalizeInstanceUrl } from "@edgeever/shared"; import { Button } from "@/components/ui/button"; import { GitHubRepositoryLink } from "@/components/GitHubRepositoryLink"; import { Input } from "@/components/ui/input"; @@ -39,7 +39,7 @@ export const LoginScreen = ({ error, instanceUrl: initialInstanceUrl, isSubmitti } onSubmit({ - ...(initialInstanceUrl !== undefined ? { instanceUrl: resolveInstanceUrlInput(instanceUrl) } : {}), + ...(initialInstanceUrl !== undefined ? { instanceUrl: normalizeInstanceUrl(instanceUrl) } : {}), username: username.trim(), password, }); @@ -83,11 +83,14 @@ export const LoginScreen = ({ error, instanceUrl: initialInstanceUrl, isSubmitti