refactor(auth): rename honeypot field to avoid autofill (#1011)

This commit is contained in:
henrygd
2026-01-09 15:12:06 -05:00
parent 7276e533ce
commit ba3d1c66f0

View File

@@ -25,13 +25,13 @@ const passwordSchema = v.pipe(
) )
const LoginSchema = v.looseObject({ const LoginSchema = v.looseObject({
name: honeypot, company_website: honeypot,
email: emailSchema, email: emailSchema,
password: passwordSchema, password: passwordSchema,
}) })
const RegisterSchema = v.looseObject({ const RegisterSchema = v.looseObject({
name: honeypot, company_website: honeypot,
email: emailSchema, email: emailSchema,
password: passwordSchema, password: passwordSchema,
passwordConfirm: passwordSchema, passwordConfirm: passwordSchema,
@@ -248,8 +248,8 @@ export function UserAuthForm({
)} )}
<div className="sr-only"> <div className="sr-only">
{/* honeypot */} {/* honeypot */}
<label htmlFor="name"></label> <label htmlFor="company_website"></label>
<input id="name" type="text" name="name" tabIndex={-1} autoComplete="off" /> <input id="company_website" type="text" name="company_website" tabIndex={-1} autoComplete="off" />
</div> </div>
<button className={cn(buttonVariants())} disabled={isLoading}> <button className={cn(buttonVariants())} disabled={isLoading}>
{isLoading ? ( {isLoading ? (
@@ -305,9 +305,9 @@ export function UserAuthForm({
className="me-2 h-4 w-4 dark:brightness-0 dark:invert" className="me-2 h-4 w-4 dark:brightness-0 dark:invert"
src={getAuthProviderIcon(provider)} src={getAuthProviderIcon(provider)}
alt="" alt=""
// onError={(e) => { // onError={(e) => {
// e.currentTarget.src = "/static/lock.svg" // e.currentTarget.src = "/static/lock.svg"
// }} // }}
/> />
)} )}
<span className="translate-y-px">{provider.displayName}</span> <span className="translate-y-px">{provider.displayName}</span>