Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

refactor(signup): remove name input and use email prefix as default name

Bill Yang821bf64daf26
diff --git a/client/src/app/invitation/components/signup.tsx b/client/src/app/invitation/components/signup.tsx
index 8e1b4b4c2..b9c5a43c3 100644
--- a/client/src/app/invitation/components/signup.tsx
+++ b/client/src/app/invitation/components/signup.tsx
@@ -16,7 +16,6 @@ interface SignupProps {
export function Signup({ inviterEmail, organization }: SignupProps) {
const [isLoading, setIsLoading] = useState(false);
const [error, setError] = useState<string>("");
- const [name, setName] = useState("");
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
@@ -28,7 +27,7 @@ export function Signup({ inviterEmail, organization }: SignupProps) {
try {
const { data, error } = await authClient.signUp.email({
email,
- name,
+ name: email.split("@")[0], // Use email prefix as default name
password,
});
@@ -53,15 +52,6 @@ export function Signup({ inviterEmail, organization }: SignupProps) {
return (
<form onSubmit={handleSignup}>
<div className="flex flex-col gap-4">
- <AuthInput
- id="name"
- label="Name"
- type="text"
- placeholder="Your name"
- value={name}
- onChange={(e) => setName(e.target.value)}
- />
-
<AuthInput
id="email"
label="Email"
diff --git a/client/src/app/signup/page.tsx b/client/src/app/signup/page.tsx
index eae87c5b5..43ae99ed1 100644
--- a/client/src/app/signup/page.tsx
+++ b/client/src/app/signup/page.tsx
@@ -64,7 +64,6 @@ export default function SignupPage() {
// Step 1: Account creation
const [email, setEmail] = useState("");
- const [name, setName] = useState("");
const [password, setPassword] = useState("");
// Step 2: Organization creation
@@ -105,7 +104,7 @@ export default function SignupPage() {
try {
const { data, error } = await authClient.signUp.email({
email,
- name,
+ name: email.split("@")[0], // Use email prefix as default name
password,
});
@@ -218,15 +217,6 @@ export default function SignupPage() {
>
<h2 className="text-2xl font-semibold mb-6">Create your account</h2>
<div className="space-y-4">
- <AuthInput
- id="name"
- label="Name"
- type="text"
- placeholder="Your name"
- value={name}
- onChange={(e) => setName(e.target.value)}
- />
-
<AuthInput
id="email"
label="Email"