-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restore user credentials in HttpBackgroundJob #14329
Conversation
Hi @jtkech ,I use these changes to work well in my code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain scenarios where you used this?
src/OrchardCore/OrchardCore.Abstractions/BackgroundJobs/HttpBackgroundJob.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Abstractions/BackgroundJobs/HttpBackgroundJob.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Abstractions/BackgroundJobs/HttpBackgroundJob.cs
Outdated
Show resolved
Hide resolved
…ckgroundJob.cs Co-authored-by: Zoltán Lehóczky <zoltan.lehoczky@lombiq.com>
…ckgroundJob.cs Co-authored-by: Zoltán Lehóczky <zoltan.lehoczky@lombiq.com>
src/OrchardCore/OrchardCore.Abstractions/BackgroundJobs/HttpBackgroundJob.cs
Outdated
Show resolved
Hide resolved
…ckgroundJob.cs Co-authored-by: Zoltán Lehóczky <zoltan.lehoczky@lombiq.com>
Just to confirm: are you done? |
Yes, please review it ,thanks! |
Should it be done directly in |
Not really, because you don't always have an actual HTTP request. This is about executing something after a real HTTP request, but with a different |
use
httpContextAccessor.HttpContext.User.Clone();
to set newHttpContext.User
This PR is submitted in order to start the workflow asynchronously in the script, because this will create a new http context, which will make it impossible to retrieve user information