[FEAT] Table Creation for Social Oauth Tokens #231
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Checklist: