Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public async Task<IActionResult> OnGetCallbackAsync(string? returnUrl = null, st
if (user != null)
{
await referralService.EnsureReferralIdAsync(user);
Copy link

Copilot AI Jul 11, 2025

Choose a reason for hiding this comment

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

[nitpick] The logic to ensure referral ID and then refresh or sign in the user is duplicated in both existing and new user flows. Consider extracting this into a shared helper method to reduce duplication and improve readability.

Copilot uses AI. Check for mistakes.
// Refresh sign-in to pick up the newly added referral ID claim
await signInManager.RefreshSignInAsync(user);
}
return LocalRedirect(returnUrl);
}
Expand Down Expand Up @@ -189,6 +191,8 @@ await emailSender.SendEmailAsync(Input.Email, "Confirm your email",
return RedirectToPage("./RegisterConfirmation", new { Email = Input.Email });
}

// Ensure referral ID is set for the new user before signing in
await referralService.EnsureReferralIdAsync(user);
await signInManager.SignInAsync(user, isPersistent: false, info.LoginProvider);
return LocalRedirect(returnUrl);
}
Expand Down