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
feat: Implement the ability to login via multiple means when signed up via google/non-cal providers #14082
Conversation
… via non-cal providers
@asadath1395 is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link. |
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (03/14/24)1 reviewer was added to this PR based on Keith Williams's automation. "Add community label" took an action on this PR • (03/14/24)1 label was added to this PR based on Keith Williams's automation. "Add foundation team as reviewer" took an action on this PR • (03/25/24)1 reviewer was added to this PR based on Keith Williams's automation. |
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
…account-password
…users manually disconnect connected accounts and refactor code
… SSO and email if account password is set
… with google using the same account
@@ -57,7 +57,7 @@ inferSSRProps<typeof getServerSideProps> & WithNonceProps<{}>) { | |||
.string() | |||
.min(1, `${t("error_required_field")}`) | |||
.email(`${t("enter_valid_email")}`), | |||
password: !!totpEmail ? z.literal("") : z.string().min(1, `${t("error_required_field")}`), | |||
...(!!totpEmail ? {} : { password: z.string().min(1, `${t("error_required_field")}`) }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bug fixed in this PR #10288 resurfaced again, so fixed that too in this PR
@@ -106,23 +106,16 @@ const ProfileView = () => { | |||
const updateProfileMutation = trpc.viewer.updateProfile.useMutation({ | |||
onSuccess: async (res) => { | |||
await update(res); | |||
// signout user only in case of password reset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is part of legacy code when user created an account using google, then changed the email which send password reset code, the flow is changed in this PR
@@ -807,22 +807,6 @@ export const AUTH_OPTIONS: AuthOptions = { | |||
}, | |||
}); | |||
|
|||
// safely delete password from UserPassword table if it exists | |||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously when user created an account and then logged in via google then his password was deleted, now we no longer do that because we let users log in via google and email + password
…then creates account password
@CarinaWolli Do you have the bandwidth to review this PR? Or maybe delegate it to someone from the team. Thank you! |
This seems like a nice improvement! Will start reviewing soon. 🙏🏽 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally and worked fine. Cannot test google login on Vercel preview deployments. Tests and checks are passing. Will merge and test on Canary before releasing.
@@ -320,7 +316,7 @@ export const updateProfileHandler = async ({ ctx, input }: UpdateProfileOptions) | |||
}); | |||
} | |||
|
|||
if (updatedUser && hasEmailChangedOnCalProvider) { | |||
if (updatedUser) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woops, not putting hasEmailBeenChanged here caused email verification emails to be sent on every user profile update 👎
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oversight from my side, sorry about that. Thanks for fixing it :)
I just stumbled into an error in prod when trying to unlink a google account. Will post more details soon. EDIT: Here's the redacted stack trace:
|
What does this PR do?
Fixes #13978
Type of change
How should this be tested?
Scenario 1
/settings/security/password
Scenario 2
Verify the steps in this PR #10288
Scenario 3
/settings/my-account/profile
and try disconnecting the linked accountMandatory Tasks