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:

Fix the referral ID being null for users who sign in via external logins by ensuring that the referral ID is assigned after successful external authentication.

Steps:

  1. Inject IReferralService into the ExternalLoginModel (Areas/Identity/Pages/Account/ExternalLogin.cshtml.cs).
  2. After a successful sign-in (i.e., after SignInManager.SignInAsync and before redirect), call referralService.EnsureReferralIdAsync(user) to make sure the user gets a referral ID claim.
  3. This ensures that hyperlinks for logged-in users always have a non-null referral ID, regardless of login method.

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

Fix the referral ID being null for users who sign in via external logins by ensuring that the referral ID is assigned after successful external authentication.

Steps:

  1. Inject IReferralService into the ExternalLoginModel (Areas/Identity/Pages/Account/ExternalLogin.cshtml.cs).
  2. After a successful sign-in (i.e., after SignInManager.SignInAsync and before redirect), call referralService.EnsureReferralIdAsync(user) to make sure the user gets a referral ID claim.
  3. This ensures that hyperlinks for logged-in users always have a non-null referral ID, regardless of login method.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

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