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

Link accounts and stop account creation from sign in page #726

Merged
merged 7 commits into from
Aug 22, 2024

Conversation

erikguntner
Copy link
Collaborator

@erikguntner erikguntner commented Jun 18, 2024

Closes #703

What changes did you make?

  • Refactored the existing /token endpoint and split it into '/google/sign_inand/google/sign_up`
  • The /google/sign_up endpoint handles the creation of a user that signs up with Google. The endpoint will throw an error and delete the user created in AWS if the role is not provided or is incorrect.
  • The '/google/sign_in` endpoint handles signing in a user that is created by Google. The endpoint will throw an error and delete the user created in AWS if an existing user is not found in the database because this means the user has not gone through the signup process yet.
  • Updated the client to use the endpoints for sign up and sign in.
  • Created a lambda function that links user accounts if the user first signed up with email and password and then signs in with Google.

Rationale behind the changes?

  • We wanted the ability to link user accounts so those who are invited or decide they want to use the Google sign in after creating an account can do so.
  • We needed a way to roll back user account creation if the user signed in with Google without going through the sign up process first.

Testing done for these changes

  • I did manual testing using our database and AWS Cognito resource and going through the necessary user flows.

Screenshots of Proposed Changes Of The Website (if any, please do not screen shot code changes)

Visuals before changes are applied

Uploading Screen Recording 2024-06-18 at 3.54.43 PM.mov…

Visuals after changes are applied

This video shows how a user signing in with a Google account without signing up first will throw an error.
Uploading Screen Recording 2024-06-18 at 4.02.17 PM.mov…

@erikguntner erikguntner changed the title Link accounts Link accounts and stop account creation from sign in page Jun 18, 2024
@erikguntner
Copy link
Collaborator Author

@tylerthome @johnwroge @JpadillaCoding @paulespinosa could I get a review on this, please?

@johnwroge johnwroge closed this Aug 21, 2024
@johnwroge johnwroge reopened this Aug 21, 2024
Copy link
Member

@johnwroge johnwroge left a comment

Choose a reason for hiding this comment

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

Looks great, thanks Erik!

@paulespinosa paulespinosa merged commit f69d05b into main Aug 22, 2024
3 of 4 checks passed
@paulespinosa paulespinosa deleted the link-accounts branch August 22, 2024 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Link accounts and stop Google account creation from the sign in page
3 participants