I have successfully authenticated my app, but the only thing that I can't seem to do is change the user properties that I have made.
public async Task<IActionResult> OnPostAsync()
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
}
if (!ModelState.IsValid)
{
LoadAsync(user);
return Page();
}
var phonenumber = await _userManager.GetPhoneNumberAsync(user);
if (Input.PhoneNumber != phonenumber)
{
var setPhoneNumber = await _userManager.SetPhoneNumberAsync(user, Input.PhoneNumber);
}
user.FirstName = Input.FirstName;
return RedirectToPage();
}
If anybody knows how to change the FirstName property, thank you.