Skip to content

Commit efb4362

Browse files
chore(security): disable autocomplete on sensitive input fields
Disable autocomplete on authentication and security-related forms to prevent browsers from storing sensitive credentials. This affects sign-in, password reset, account security, and onboarding forms across admin, web, and space apps. Modified components: - Auth forms (email, password, unique code, forgot/reset/set password) - Account security pages - Instance setup and profile onboarding - Shared UI components (auth-input, password-input)
1 parent 110dbd9 commit efb4362

File tree

21 files changed

+55
-40
lines changed

21 files changed

+55
-40
lines changed

apps/admin/app/(all)/(home)/sign-in-form.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export function InstanceSignInForm() {
140140
placeholder="[email protected]"
141141
value={formData.email}
142142
onChange={(e) => handleFormChange("email", e.target.value)}
143-
autoComplete="on"
143+
autoComplete="off"
144144
autoFocus
145145
/>
146146
</div>
@@ -159,7 +159,7 @@ export function InstanceSignInForm() {
159159
placeholder="Enter your password"
160160
value={formData.password}
161161
onChange={(e) => handleFormChange("password", e.target.value)}
162-
autoComplete="on"
162+
autoComplete="off"
163163
/>
164164
{showPassword ? (
165165
<button

apps/admin/core/components/instance/setup-form.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ export function InstanceSetupForm() {
204204
value={formData.email}
205205
onChange={(e) => handleFormChange("email", e.target.value)}
206206
hasError={errorData.type && errorData.type === EErrorCodes.INVALID_EMAIL ? true : false}
207-
autoComplete="on"
207+
autoComplete="off"
208208
/>
209209
{errorData.type && errorData.type === EErrorCodes.INVALID_EMAIL && errorData.message && (
210210
<p className="px-1 text-11 text-danger-primary">{errorData.message}</p>
@@ -244,7 +244,7 @@ export function InstanceSetupForm() {
244244
hasError={errorData.type && errorData.type === EErrorCodes.INVALID_PASSWORD ? true : false}
245245
onFocus={() => setIsPasswordInputFocused(true)}
246246
onBlur={() => setIsPasswordInputFocused(false)}
247-
autoComplete="on"
247+
autoComplete="new-password"
248248
/>
249249
{showPassword.password ? (
250250
<button
@@ -288,6 +288,7 @@ export function InstanceSetupForm() {
288288
className="w-full border border-subtle !bg-surface-1 pr-12 placeholder:text-placeholder"
289289
onFocus={() => setIsRetryPasswordInputFocused(true)}
290290
onBlur={() => setIsRetryPasswordInputFocused(false)}
291+
autoComplete="new-password"
291292
/>
292293
{showPassword.retypePassword ? (
293294
<button

apps/space/core/components/account/auth-forms/email.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export const AuthEmailForm = observer(function AuthEmailForm(props: TAuthEmailFo
6969
onChange={(e) => setEmail(e.target.value)}
7070
placeholder="[email protected]"
7171
className={`disable-autofill-style h-10 w-full placeholder:text-placeholder autofill:bg-danger-subtle border-0 focus:bg-none active:bg-transparent`}
72-
autoComplete="on"
72+
autoComplete="off"
7373
autoFocus
7474
ref={inputRef}
7575
/>

apps/space/core/components/account/auth-forms/password.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export const AuthPasswordForm = observer(function AuthPasswordForm(props: Props)
153153
className="disable-autofill-style h-10 w-full border border-subtle !bg-surface-1 pr-12 placeholder:text-placeholder"
154154
onFocus={() => setIsPasswordInputFocused(true)}
155155
onBlur={() => setIsPasswordInputFocused(false)}
156-
autoComplete="on"
156+
autoComplete="off"
157157
autoFocus
158158
/>
159159
{showPassword?.password ? (
@@ -186,6 +186,7 @@ export const AuthPasswordForm = observer(function AuthPasswordForm(props: Props)
186186
className="disable-autofill-style h-10 w-full border border-subtle !bg-surface-1 pr-12 placeholder:text-placeholder"
187187
onFocus={() => setIsRetryPasswordInputFocused(true)}
188188
onBlur={() => setIsRetryPasswordInputFocused(false)}
189+
autoComplete="off"
189190
/>
190191
{showPassword?.retypePassword ? (
191192
<EyeOff

apps/space/core/components/account/auth-forms/unique-code.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ export function AuthUniqueCodeForm(props: TAuthUniqueCodeForm) {
9292
onChange={(e) => handleFormChange("email", e.target.value)}
9393
placeholder="[email protected]"
9494
className={`disable-autofill-style h-10 w-full placeholder:text-placeholder border-0`}
95+
autoComplete="off"
9596
disabled
9697
/>
9798
{uniqueCodeFormData.email.length > 0 && (
@@ -113,6 +114,7 @@ export function AuthUniqueCodeForm(props: TAuthUniqueCodeForm) {
113114
onChange={(e) => handleFormChange("code", e.target.value)}
114115
placeholder="123456"
115116
className="disable-autofill-style h-10 w-full border border-subtle !bg-surface-1 pr-12 placeholder:text-placeholder"
117+
autoComplete="off"
116118
autoFocus
117119
/>
118120
<div className="flex w-full items-center justify-between px-1 text-11 pt-1">

apps/web/app/(all)/[workspaceSlug]/(settings)/settings/account/security/page.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ function SecurityPage() {
144144
placeholder={t("old_password")}
145145
className="w-full"
146146
hasError={Boolean(errors.old_password)}
147+
autoComplete="current-password"
147148
/>
148149
)}
149150
/>
@@ -184,6 +185,7 @@ function SecurityPage() {
184185
hasError={Boolean(errors.new_password)}
185186
onFocus={() => setIsPasswordInputFocused(true)}
186187
onBlur={() => setIsPasswordInputFocused(false)}
188+
autoComplete="new-password"
187189
/>
188190
)}
189191
/>
@@ -226,6 +228,7 @@ function SecurityPage() {
226228
hasError={Boolean(errors.confirm_password)}
227229
onFocus={() => setIsRetryPasswordInputFocused(true)}
228230
onBlur={() => setIsRetryPasswordInputFocused(false)}
231+
autoComplete="new-password"
229232
/>
230233
)}
231234
/>

apps/web/app/(all)/profile/security/page.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ function SecurityPage() {
142142
placeholder={t("old_password")}
143143
className="w-full"
144144
hasError={Boolean(errors.old_password)}
145+
autoComplete="current-password"
145146
/>
146147
)}
147148
/>
@@ -182,6 +183,7 @@ function SecurityPage() {
182183
hasError={Boolean(errors.new_password)}
183184
onFocus={() => setIsPasswordInputFocused(true)}
184185
onBlur={() => setIsPasswordInputFocused(false)}
186+
autoComplete="new-password"
185187
/>
186188
)}
187189
/>
@@ -224,6 +226,7 @@ function SecurityPage() {
224226
hasError={Boolean(errors.confirm_password)}
225227
onFocus={() => setIsRetryPasswordInputFocused(true)}
226228
onBlur={() => setIsRetryPasswordInputFocused(false)}
229+
autoComplete="new-password"
227230
/>
228231
)}
229232
/>

apps/web/core/components/account/auth-forms/email.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const AuthEmailForm = observer(function AuthEmailForm(props: TAuthEmailFo
6868
onChange={(e) => setEmail(e.target.value)}
6969
placeholder={t("auth.common.email.placeholder")}
7070
className={`disable-autofill-style h-10 w-full placeholder:text-placeholder autofill:bg-danger-primary border-0 focus:bg-none active:bg-transparent`}
71-
autoComplete="on"
71+
autoComplete="off"
7272
autoFocus
7373
ref={inputRef}
7474
/>

apps/web/core/components/account/auth-forms/forgot-password.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export const ForgotPasswordForm = observer(function ForgotPasswordForm() {
9898
hasError={Boolean(errors.email)}
9999
placeholder={t("auth.common.email.placeholder")}
100100
className="h-10 w-full border border-strong !bg-surface-1 pr-12 placeholder:text-placeholder"
101-
autoComplete="on"
101+
autoComplete="off"
102102
disabled={resendTimerCode > 0}
103103
/>
104104
)}

apps/web/core/components/account/auth-forms/password.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ export const AuthPasswordForm = observer(function AuthPasswordForm(props: Props)
207207
className="disable-autofill-style h-10 w-full border border-strong !bg-surface-1 pr-12 placeholder:text-placeholder"
208208
onFocus={() => setIsPasswordInputFocused(true)}
209209
onBlur={() => setIsPasswordInputFocused(false)}
210-
autoComplete="on"
210+
autoComplete="off"
211211
autoFocus
212212
/>
213213
<button
@@ -244,6 +244,7 @@ export const AuthPasswordForm = observer(function AuthPasswordForm(props: Props)
244244
className="disable-autofill-style h-10 w-full border border-strong !bg-surface-1 pr-12 placeholder:text-placeholder"
245245
onFocus={() => setIsRetryPasswordInputFocused(true)}
246246
onBlur={() => setIsRetryPasswordInputFocused(false)}
247+
autoComplete="off"
247248
/>
248249
<button
249250
type="button"

0 commit comments

Comments
 (0)