diff --git a/changelog/unreleased/freemilk-paste-callback-login.md b/changelog/unreleased/freemilk-paste-callback-login.md new file mode 100644 index 000000000..cc1580fce --- /dev/null +++ b/changelog/unreleased/freemilk-paste-callback-login.md @@ -0,0 +1,7 @@ +### English + +- FreeMilk login now opens Google directly and finishes when you paste the `com.googleusercontent.apps…:/oauth2callback?code=…` redirect URL into the wizard. The old 127.0.0.1 forwarder never received the app-scheme redirect and could not be reached from a remote console. + +### 中文 + +- FreeMilk 登录现在直接打开 Google,把 `com.googleusercontent.apps…:/oauth2callback?code=…` 回调地址粘贴进向导即可完成。原来的 127.0.0.1 转发收不到 App scheme 回调,部署在服务器上时浏览器也访问不到。 diff --git a/frontend/src/components/AddAccountModal.tsx b/frontend/src/components/AddAccountModal.tsx index bc3222eff..c09e9af42 100644 --- a/frontend/src/components/AddAccountModal.tsx +++ b/frontend/src/components/AddAccountModal.tsx @@ -226,6 +226,8 @@ export function AddAccountModal({ isOpen, onClose, onAdded }: Props) { // so the wizard opens on the PAT tab instead of the browser tab. const hasBrowserLogin = activeOption?.descriptor.capabilities?.browser_login !== false const showCallbackPaste = activeOption?.provider === 'trae' || activeOption?.provider === 'devin' || activeOption?.provider === 'codex' || activeOption?.provider === 'codearts' || activeOption?.provider === 'freemilk' + const callbackLeadKey = activeOption?.provider === 'freemilk' ? 'freemilkCallbackLead' : 'wizardCallbackLead' + const callbackPhKey = activeOption?.provider === 'freemilk' ? 'freemilkCallbackPh' : 'wizardCallbackPh' const busy = phase === 'busy' || phase === 'polling' const settingsLocked = Boolean(createdId.current) || busy const isDone = phase === 'done' @@ -398,7 +400,7 @@ export function AddAccountModal({ isOpen, onClose, onAdded }: Props) { async function runCallback() { const pasted = callbackUrl.trim() if (!pasted) { - setMessage(t('wizardCallbackPh')) + setMessage(t(callbackPhKey)) return } try { @@ -970,13 +972,13 @@ export function AddAccountModal({ isOpen, onClose, onAdded }: Props) { ) : null} {showCallbackPaste ? (
-

{t('wizardCallbackLead')}

+

{t(callbackLeadKey)}