Skip to content

fix: prevent email from being altered #1863

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 27, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
disable email field on account page
  • Loading branch information
f0ssel committed May 27, 2022
commit a101fa1e8ca2a80ef7d963d01b5043a7480c0791
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@ interface AccountFormValues {
export const Language = {
usernameLabel: "Username",
emailLabel: "Email",
emailInvalid: "Please enter a valid email address.",
emailRequired: "Please enter an email address.",
updateSettings: "Update settings",
}

const validationSchema = Yup.object({
email: Yup.string().trim().email(Language.emailInvalid).required(Language.emailRequired),
username: nameValidator(Language.usernameLabel),
})

Expand Down Expand Up @@ -59,6 +56,7 @@ export const AccountForm: React.FC<AccountFormProps> = ({
fullWidth
label={Language.emailLabel}
variant="outlined"
disabled={true}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
disabled={true}
disabled

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we should remove the getFieldHelpers("email") and onChange and autoComplete here.

At a minimum, can you remove the autoComplete (doesn't make much sense for a disabled field).

/>
<TextField
{...getFieldHelpers("username")}
Expand Down