0
nikolay.nikolov@solutionking.com created
Hello guys. I have a question. Is it posible to load the profile after custom login with: await ProfileAppService.GetAsync(); and then to update it with ProfileAppService.UpdateAsync(...
When I try to do that I receive an error:
Exception of type 'Volo.Abp.Authorization.AbpAuthorizationException' was thrown.
Here is a part of my code:
await SignInManager.SignInAsync(user, isPersistent: false);
await IdentityServerEvents.RaiseAsync(new UserLoginSuccessEvent(user.UserName, user.Id.ToString(), user.UserName));
then:
var profile = await ProfileAppService.GetAsync(); (this is the exception place)
1 Answer(s)
-
2
HI
You can try to use
CurrentPrincipalAccessor.Change
.//ICurrentPrincipalAccessor CurrentPrincipalAccessor; await SignInManager.SignInAsync(user, isPersistent: false); using (CurrentPrincipalAccessor.Change(await SignInManager.CreateUserPrincipalAsync(user))) { var profile = await ProfileAppService.GetAsync(); }