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

feat: add auth with google #132

Merged
merged 6 commits into from
Aug 27, 2024
Merged

feat: add auth with google #132

merged 6 commits into from
Aug 27, 2024

Conversation

TutTrue
Copy link
Member

@TutTrue TutTrue commented Aug 21, 2024

Description

Please provide a brief summary of the changes in this PR.

Type of Change

  • Bug fix
  • [ X] New feature
  • Test case
  • Documentation update
  • Other (please describe)

Checklist

  • I have added tests that prove my fix is effective or that my feature works (optional)
  • I have added necessary documentation (if applicable)

4- steps to test ?

login with google

Please provide a brief summary of the steps required to test the changes in this PR.

5- results ?

Please provide a brief summary of the results after testing the changes in this PR.

added login with google endpoint

7- screenshots ?

Please provide screenshots of the results after testing the changes in this PR.

@TutTrue TutTrue added the enhancement New feature or request label Aug 21, 2024
@TutTrue TutTrue self-assigned this Aug 21, 2024
@AhmedAbdelmenam
Copy link
Contributor

Screenshot 2024-08-23 at 9 14 23 PM i have some bugs with your code when I build and it will broken the server if I merge it can you fix this, please

@AhmedAbdelmenam
Copy link
Contributor

and when i click on the google icon the pop up appear but didn't open any thing
Uploading Screenshot 2024-08-23 at 9.17.10 PM.png…

@TutTrue
Copy link
Member Author

TutTrue commented Aug 23, 2024

You have to push the database first
run:
npx prisma db push
npx prisma generate
and build again

});

if (
Copy link
Contributor

Choose a reason for hiding this comment

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

this IF block can be simplified to

if (
  alreadyExistingUser &&
  email &&
  (
    !alreadyExistingUser.email ||
    alreadyExistingUser.authType !== "GOOGLE" ||
    alreadyExistingUser.authProviderId !== googleId ||
    alreadyExistingUser.name !== name
  )
) {
  ...
}

unless there is a need to check the existence of both authType and authProviderId simultaneously. and existence of email should also be separately checked since we're updating with it nonetheless.

Copy link
Member Author

Choose a reason for hiding this comment

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

This if will be modified in the next feature depending on the coming logic so it's not a big deal right now

@AhmedAbdelmenam AhmedAbdelmenam merged commit ecf9a45 into dev Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants