Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
f0ssel merged 6 commits intomainfromf0ssel/github-auth-lock
May 27, 2022
Merged

Conversation

f0ssel
Copy link
Contributor

@f0sself0ssel commentedMay 27, 2022
edited
Loading

Fixes:#1490
Fixes:#1725

Copy link
Member

@kylecarbskylecarbs left a comment

Choose a reason for hiding this comment

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

It'd be nice if you removed the frontend in this PR too. It'd be good to build the habit of not having broken states in our main deployment.

I'm happy to help if you encounter any issues. That's not a blocker though, just a suggestion!

@BrunoQuaresma
Copy link
Collaborator

BrunoQuaresma commentedMay 27, 2022
edited
Loading

@f0ssel feel free to do the FE if you want but if not, which is 100% ok, could you create a ticket for this and add the FE label, and make it Community MVP, please?

f0ssel reacted with thumbs up emoji

@f0ssel
Copy link
ContributorAuthor

💯 I would not merge this as is, frontend will be same PR

kylecarbs reacted with rocket emoji

@f0sself0ssel requested a review froma team as acode ownerMay 27, 2022 18:48
@f0ssel
Copy link
ContributorAuthor

@BrunoQuaresma This is ready for frontend review

@greyscaled
Copy link
Contributor

Will still need to make the frontend field readonly and only send the username in the update payload.

FE ticket is here:#1725

@@ -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 thegetFieldHelpers("email") andonChange andautoComplete here.

At a minimum, can you remove theautoComplete (doesn't make much sense for adisabled field).

Copy link
Contributor

@greyscaledgreyscaled left a comment

Choose a reason for hiding this comment

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

Here's a patch I'd prefer to be applied to the FE code. It cleans up the form so thatemail is read-only and not associated with theFormik form.

diff --git a/site/src/components/SettingsAccountForm/SettingsAccountForm.tsx b/site/src/components/SettingsAccountForm/SettingsAccountForm.tsxindex 3773b307..4c90deb6 100644--- a/site/src/components/SettingsAccountForm/SettingsAccountForm.tsx+++ b/site/src/components/SettingsAccountForm/SettingsAccountForm.tsx@@ -8,7 +8,6 @@ import { LoadingButton } from "../LoadingButton/LoadingButton" import { Stack } from "../Stack/Stack"  interface AccountFormValues {-  email: string   username: string }@@ -23,7 +22,9 @@ const validationSchema = Yup.object({ })  export type AccountFormErrors = FormikErrors<AccountFormValues>+ export interface AccountFormProps {+  email: string   isLoading: boolean   initialValues: AccountFormValues   onSubmit: (values: AccountFormValues) => void@@ -32,6 +33,7 @@ export interface AccountFormProps { }  export const AccountForm: React.FC<AccountFormProps> = ({+  email,   isLoading,   onSubmit,   initialValues,@@ -49,15 +51,7 @@ export const AccountForm: React.FC<AccountFormProps> = ({     <>       <form onSubmit={form.handleSubmit}>         <Stack>-          <TextField-            {...getFieldHelpers("email")}-            onChange={onChangeTrimmed(form)}-            autoComplete="email"-            fullWidth-            label={Language.emailLabel}-            variant="outlined"-            disabled={true}-          />+          <TextField disabled fullWidth label={Language.emailLabel} value={email} variant="outlined" />           <TextField             {...getFieldHelpers("username")}             onChange={onChangeTrimmed(form)}diff --git a/site/src/pages/SettingsPages/AccountPage/AccountPage.tsx b/site/src/pages/SettingsPages/AccountPage/AccountPage.tsxindex 5f9cf428..5954ac64 100644--- a/site/src/pages/SettingsPages/AccountPage/AccountPage.tsx+++ b/site/src/pages/SettingsPages/AccountPage/AccountPage.tsx@@ -26,10 +26,11 @@ export const AccountPage: React.FC = () => {   return (     <Section title={Language.title}>       <AccountForm+        email={me.email}         error={hasUnknownError ? Language.unknownError : undefined}         formErrors={formErrors}         isLoading={authState.matches("signedIn.profile.updatingProfile")}-        initialValues={{ username: me.username, email: me.email }}+        initialValues={{ username: me.username }}         onSubmit={(data) => {           authSend({             type: "UPDATE_PROFILE",

@f0sself0sselenabled auto-merge (squash)May 27, 2022 22:22
@f0sself0ssel merged commit5598ac0 intomainMay 27, 2022
@f0sself0ssel deleted the f0ssel/github-auth-lock branchMay 27, 2022 22:25
kylecarbs pushed a commit that referenced this pull requestJun 10, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@kylecarbskylecarbskylecarbs approved these changes

@greyscaledgreyscaledgreyscaled approved these changes

@BrunoQuaresmaBrunoQuaresmaAwaiting requested review from BrunoQuaresma

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

FE for Bug: github auth users should not be able to change their email Bug: github auth users should not be able to change their email
4 participants
@f0ssel@BrunoQuaresma@greyscaled@kylecarbs

[8]ページ先頭

©2009-2025 Movatter.jp