Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 7, 2025

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.

Original description:

Update the external login authentication flow so that a referral ID is always set for users who log in with external providers (e.g., Google, Microsoft). This prevents REFERRAL_ID from being null for authenticated users by ensuring the referral claim is present.

Steps:

  • Inject IReferralService into the ExternalLoginModel (Areas/Identity/Pages/Account/ExternalLogin.cshtml.cs).
  • After a successful sign-in (SignInManager.SignInAsync), call referralService.EnsureReferralIdAsync(user) before redirect.
  • Test that users logging in with external providers always have a referral ID assigned.

This addresses issue #742.

This pull request was created as a result of the following prompt from Copilot chat.

Update the external login authentication flow so that a referral ID is always set for users who log in with external providers (e.g., Google, Microsoft). This prevents REFERRAL_ID from being null for authenticated users by ensuring the referral claim is present.

Steps:

  • Inject IReferralService into the ExternalLoginModel (Areas/Identity/Pages/Account/ExternalLogin.cshtml.cs).
  • After a successful sign-in (SignInManager.SignInAsync), call referralService.EnsureReferralIdAsync(user) before redirect.
  • Test that users logging in with external providers always have a referral ID assigned.

This addresses issue #742.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

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.

2 participants