issue in Signin with github
Issue:
If a user makes his email id private in email setting on his github profile, then we will be getting email=null in profile object which leads to below error based on current authentication logic.
-
May be we can authenticate based on the github username only and creating/updating users accordingly and not storing the email info in db. Need to make email field optional (this don't seem right) Downside - Everytime user changes his uername we have to make enteries in the table.
-
If we consider to add/insert email (if not null) along with username in db and user change username ex. name -> name1 , as per first approach we need make a new entry with 'username: name1' and email: {duplicate here} which leads to unique constraint error as we are trying to insert same email into different records.
-
Continue using same authentication logic and insert null email if email not exists. The issue occurs when user try to login again, here we will be fetching records where email=null can lead to update user displayName at multiple places.
Hence we can fallback to 1st approach. If you guys have any suggestions please share. cc @hkirat
Possible fix: