Skip to content

[FEAT] Table Creation for Social Oauth Tokens #231

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

Closed
wants to merge 7 commits into from
Closed

[FEAT] Table Creation for Social Oauth Tokens #231

wants to merge 7 commits into from

Conversation

johnson-oragui
Copy link
Collaborator

Description

Mapped oauth_token table, created a one-to-one relationship between the users table and the oauth_tokens table, set the password field of the user to be optional. This allows the user that did not use password authentication to be saved to the database.

Related Issue (Link to issue ticket)

Google OAuth2 Authentication for User Login (Database Design)

Motivation and Context

Without the password field of the users table been set to nullable, it means that backend cannot add the user that authenticated with social authentication to the users table, or a random/default password would be created for every user that authenticated via social before they could be added to the database, or a complete different table would be created to accommodate them. Any of the later option is what I do not see as a viable one.
By making the field nullable, creating the oauth_tokens table, and creating a one-to-one relationship between users and oauth_tokens table, every user can be added to the database. The user can decided on a later time to create a password.

How Has This Been Tested?

This has been tested with Unittests to ensure the new relationship works properly​

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

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.

1 participant