diff --git a/public/widget.js b/public/widget.js index 59ee2624..171d369a 100644 --- a/public/widget.js +++ b/public/widget.js @@ -20,7 +20,7 @@ const styles = { Object.assign(wrapper.style, styles); wrapper.src = `${new URL(_src).origin}/widget.html?host=${hostId}&themeColor=${encodeURIComponent( themeColor -)}&from=${encodeURIComponent(location.host)}`; +)}&from=${encodeURIComponent(location.hostname)}`; wrapper.width = closeWidth; wrapper.height = closeHeight; wrapper.frameborder = 0; diff --git a/src/widget/Popup/Login/index.tsx b/src/widget/Popup/Login/index.tsx index 3dc19c7f..5ec1243d 100644 --- a/src/widget/Popup/Login/index.tsx +++ b/src/widget/Popup/Login/index.tsx @@ -34,12 +34,13 @@ const Login = () => { } const data = new FormData(form); const name = data.get("username") as string; - const email = data.get("email") as string; - console.log("name,email", name, email); + // const email = data.get("email") as string; + console.log("name,email", name); + const randomEmail = `${name}-${(Math.random() + 1).toString(36).substring(7)}@${from}`; register({ - name: `${name}-[${from}]`, - email, - password: email, + name, + email: randomEmail, + password: randomEmail, }); // const content = new FormData(form).get("prompt") as string; }; @@ -61,10 +62,7 @@ const Login = () => { } } }, [error]); - - if (!loginConfigSuccess) return null; - const { github: enableGithubLogin, google: enableGoogleLogin, @@ -76,7 +74,7 @@ const Login = () => {