Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

add show password icon and autoComplete attribute

Alaister Youngc797990e5412
diff --git a/studio/components/interfaces/SignIn/ForgotPasswordForm.tsx b/studio/components/interfaces/SignIn/ForgotPasswordForm.tsx
index 56396e8844c..79d53586075 100644
--- a/studio/components/interfaces/SignIn/ForgotPasswordForm.tsx
+++ b/studio/components/interfaces/SignIn/ForgotPasswordForm.tsx
@@ -74,6 +74,7 @@ const ForgotPasswordForm = () => {
label="Email"
placeholder="[email protected]"
disabled={isSubmitting}
+ autoComplete="email"
/>
<div className="self-center">
diff --git a/studio/components/interfaces/SignIn/ResetPasswordForm.tsx b/studio/components/interfaces/SignIn/ResetPasswordForm.tsx
index 993fda7b2ed..4acce9d8d05 100644
--- a/studio/components/interfaces/SignIn/ResetPasswordForm.tsx
+++ b/studio/components/interfaces/SignIn/ResetPasswordForm.tsx
@@ -51,6 +51,7 @@ const ResetPasswordForm = () => {
label="Password"
placeholder="&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;"
disabled={isSubmitting}
+ autoComplete="new-password"
/>
<div className="border-overlay-border border-t" />
diff --git a/studio/components/interfaces/SignIn/SignInForm.tsx b/studio/components/interfaces/SignIn/SignInForm.tsx
index dd550d5b908..bf4874b23f1 100644
--- a/studio/components/interfaces/SignIn/SignInForm.tsx
+++ b/studio/components/interfaces/SignIn/SignInForm.tsx
@@ -91,6 +91,7 @@ const SignInForm = () => {
label="Email"
placeholder="[email protected]"
disabled={isSubmitting}
+ autoComplete="email"
/>
<div className="relative">
@@ -101,6 +102,7 @@ const SignInForm = () => {
label="Password"
placeholder="&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;"
disabled={isSubmitting}
+ autoComplete="current-password"
/>
{/* positioned using absolute instead of labelOptional prop so tabbing between inputs works smoothly */}
diff --git a/studio/components/interfaces/SignIn/SignUpForm.tsx b/studio/components/interfaces/SignIn/SignUpForm.tsx
index d57c950f059..4a50e1798c2 100644
--- a/studio/components/interfaces/SignIn/SignUpForm.tsx
+++ b/studio/components/interfaces/SignIn/SignUpForm.tsx
@@ -5,7 +5,7 @@ import { API_URL } from 'lib/constants'
import { passwordSchema } from 'lib/schemas'
import { useRouter } from 'next/router'
import { useRef, useState } from 'react'
-import { Button, Form, Input } from 'ui'
+import { Button, Form, IconEye, IconEyeOff, Input } from 'ui'
import * as yup from 'yup'
import PasswordConditionsHelper from './PasswordConditionsHelper'
@@ -59,6 +59,8 @@ const SignUpForm = () => {
}
}
+ const [passwordHidden, setPasswordHidden] = useState(true)
+
return (
<Form
validateOnBlur
@@ -77,15 +79,24 @@ const SignUpForm = () => {
label="Email"
placeholder="[email protected]"
disabled={isSubmitting}
+ autoComplete="email"
/>
<Input
id="password"
name="password"
- type="password"
+ type={passwordHidden ? 'password' : 'text'}
label="Password"
placeholder="&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;"
disabled={isSubmitting}
+ autoComplete="new-password"
+ actions={
+ <Button
+ icon={passwordHidden ? <IconEye /> : <IconEyeOff />}
+ type="default"
+ onClick={() => setPasswordHidden((prev) => !prev)}
+ />
+ }
/>
<PasswordConditionsHelper password={values.password} />