We've been developing a social platform with my team and we faced with a strange issue today.
People can only login and register using their college email and we use Microsoft API to authorize their requests.
In the register screen, they enter profile information and when they click "Register" the code below triggers:
public async Task<IActionResult> OnPostConfirmationAsync(string returnUrl = null)
{
returnUrl = returnUrl ?? Url.Content("~/");
// Get the information about the user from the external login provider
var info = await _signInManager.GetExternalLoginInfoAsync();
if (info == null)
{
ErrorMessage = "Error loading external login information during confirmation.";
return RedirectToPage("./Login", new { ReturnUrl = returnUrl });
}
if (ModelState.IsValid)
{
var user = CreateUser();
string userName = TruncateEmail(Input.Email);
...
}
}
For the past weeks, var info = await _signInManager.GetExternalLoginInfoAsync() worked just fine. But today the function started returning null, meaning that registration system is not working anymore.
I searched on the internet and came across this question asked here on StackOverflow. They solved their issue by updating the NuGet packages to latest versions. When I checked mine, all .NET packages have updates from v6 to v7. So I updated the project from .NET 6 to .NET 7 and updated all other Microsoft packages.
Well, it's still not working. The function keeps returning null.
Does anyone have any solution to this? Any idea would be appreciated. Thanks a lot.