Mark Drake
08/06/2024, 7:04 PMIMemberSignInManager
will not work.
Do you have any ideas or hints about what may be happening here? The second I go to the sign-in page and use the exact same credentials,s things work!
https://cdn.discordapp.com/attachments/1270457524881199296/1270457525082521791/image.png?ex=66b3c545&is=66b273c5&hm=ca250b35027572b081348e83964e3cfa6070b09d17ff151ebd7ce3da0fcef76b&
https://cdn.discordapp.com/attachments/1270457524881199296/1270457525325533338/image.png?ex=66b3c545&is=66b273c5&hm=b6b1189a30b84e22a83dae5336d4c645601b6df8371988874667cfd1c7b45a77&
https://cdn.discordapp.com/attachments/1270457524881199296/1270457525615067259/image.png?ex=66b3c546&is=66b273c6&hm=1fdee4a543658fd4d13ba0997868d42837743aa8756b513ea2719141981067cb&
https://cdn.discordapp.com/attachments/1270457524881199296/1270457525874987018/image.png?ex=66b3c546&is=66b273c6&hm=d387370945aec4bcd93be479dd9f342182375134e368691d26a2d18df3912ffd&Rachel D
08/06/2024, 7:25 PMMatt Wise
08/06/2024, 7:36 PMMark Drake
08/06/2024, 7:46 PMMark Drake
08/06/2024, 7:58 PMMark Drake
08/07/2024, 12:45 AM_memberService.CreateMemberWithIdentity
with MemberIdentityUser.CreateNew
- Used _memberManager.CreateAsync
with the result of the above CreateNew
Everything magically works if you do it in this order.
If you try to use the member service to create everything all at once, it seems like a race condition exists.Mark Drake
08/07/2024, 12:48 AMMark Drake
08/07/2024, 12:50 AMvar identityUser = MemberIdentityUser.CreateNew(
email,
email,
memberType.Alias,
true,
$"{firstName} {lastName}");
var identityResult = await _memberManager.CreateAsync(identityUser, password);
if (identityResult.Succeeded)
{
IMember? member = _memberService.GetByKey(identityUser.Key);
member.SetValue("firstName", firstName);
member.SetValue("lastName", lastName);
_memberService.Save(member);
await _signInManager.SignInAsync(identityUser, false);
}