Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: signin/idtoken: insert user provider if user provider not found #590

Merged
merged 1 commit into from
Nov 28, 2024

Conversation

dbarrosop
Copy link
Member

@dbarrosop dbarrosop commented Nov 28, 2024

PR Type

Bug fix, Tests


Description

  • Added a new boolean return value in postSigninIdtokenCheckUserExists to indicate if the provider was found.
  • Updated PostSigninIdtoken to handle the new return value and insert the user provider if not found.
  • Enhanced test cases to mock and verify the insertion of user provider during sign-in.

Changes walkthrough 📝

Relevant files
Bug fix
post_signin_idtoken.go
Handle missing user provider during sign-in                           

go/controller/post_signin_idtoken.go

  • Added a new boolean return value to indicate if the provider was
    found.
  • Updated the postSigninIdtokenCheckUserExists function to handle the
    new return value.
  • Modified the PostSigninIdtoken function to use the new return value.
  • Inserted user provider if not found during sign-in.
  • +26/-9   
    Tests
    post_signin_idtoken_test.go
    Add tests for inserting user provider during sign-in         

    go/controller/post_signin_idtoken_test.go

  • Added test cases to mock InsertUserProvider function.
  • Verified the insertion of user provider when not found.
  • +20/-0   

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
    🧪 PR contains tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Possible Bug
    The function postSigninIdtokenCheckUserExists now returns four values, but the handling of these return values should be carefully reviewed to ensure that all possible cases are correctly managed, especially the new boolean flags.

    Code Smell
    The postSigninIdtokenSignin function now includes logic to insert a user provider if not found. This could be refactored to separate concerns and improve readability.

    Copy link
    Contributor

    PR Code Suggestions ✨

    @dbarrosop dbarrosop merged commit 3e2ffd3 into main Nov 28, 2024
    11 checks passed
    @dbarrosop dbarrosop deleted the insert-user-provider branch November 28, 2024 11:03
    # for free to join this conversation on GitHub. Already have an account? # to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants