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

Fix/Login with Google #116

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Fix/Login with Google #116

wants to merge 2 commits into from

Conversation

Zjyslav
Copy link
Collaborator

@Zjyslav Zjyslav commented Jun 28, 2024

There were still some problems with login and registration using Google. I think I fixed them. Now it works great for me.
What I did:

  • I added some null checks and made sure claim values we work with are not null at any point.
  • I placed a call to log out of Google claims at a better place. There was a call before, but it was so far down, that if you failed to log in, you wouldn't get logged out of Google.
  • I changed LogInWithGoogleAsync to use email instead of username, because username is much more likely to change (both on our side and on Google's) than email. We can't have a situation in which I decide to drop my middle name from my Google name and can no longer login to TutorLizard.
  • I did some refactoring, so that we have one method handling signing in based on LogInResult instead of the same logic duplicated. That way we can ensure user claims are consistent no matter what login method is used.
  • Some minor changes to names and removal on unnecessary code fragments.

Added some null checks.
Added logging out of Google Auth claims.
Changed LogInWithGoogleAsync to use email and googleId instead of username and googleId, because username is more likely to change and cause problems.
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.

None yet

1 participant