Skip to content
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

Prevent verification email after signup #9306

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
// eslint-disable-next-line max-len
import { useUpdateSubscriptionPreferencesMutation } from 'state/api/trpc/subscription/useUpdateSubscriptionPreferencesMutation';
import {
useUpdateUserEmailMutation,
useUpdateUserEmailSettingsMutation,
useUpdateUserMutation,
} from 'state/api/user';
Expand Down Expand Up @@ -45,7 +44,6 @@ const PersonalInformationStep = ({
const debouncedSearchTerm = useDebounce<string>(currentUsername, 500);

const user = useUserStore();
const { mutateAsync: updateEmail } = useUpdateUserEmailMutation({});
const { mutateAsync: updateEmailSettings } =
useUpdateUserEmailSettingsMutation();
const { refetch: refetchProfileData } = useFetchProfileByIdQuery({
Expand Down Expand Up @@ -130,11 +128,6 @@ const PersonalInformationStep = ({
},
});

// set email for notifications
if (values.email) {
await updateEmail({ email: values.email });
}

Comment on lines -133 to -137
Copy link
Contributor

Choose a reason for hiding this comment

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

removing this would break email saving logic for users with normal account creation flows. If we want to prevent on SSO emails from hitting the /updateEmail API then we should hide that email from getting displayed in this form, that would be somewhere along these lines

if (values.enableAccountNotifications) {
await updateSubscriptionPreferences({
id: user.id,
Expand Down
Loading