File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
src/Plugins/BotSharp.Plugin.Twilio/Services Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 2
2
using BotSharp . Abstraction . Routing ;
3
3
using BotSharp . Core . Infrastructures ;
4
4
using BotSharp . Plugin . Twilio . Models ;
5
+ using Microsoft . AspNetCore . Http ;
5
6
using Microsoft . Extensions . Hosting ;
7
+ using System . Security . Claims ;
6
8
using System . Threading ;
7
9
using Task = System . Threading . Tasks . Task ;
8
10
@@ -58,6 +60,11 @@ private async Task ProcessUserMessageAsync(CallerMessage message)
58
60
using var scope = _serviceProvider . CreateScope ( ) ;
59
61
var sp = scope . ServiceProvider ;
60
62
63
+ // Clean static HttpContext
64
+ var httpContext = sp . GetRequiredService < IHttpContextAccessor > ( ) ;
65
+ httpContext . HttpContext = new DefaultHttpContext ( ) ;
66
+ httpContext . HttpContext . User = new ClaimsPrincipal ( new ClaimsIdentity ( ) ) ;
67
+
61
68
AssistantMessage reply = null ;
62
69
var inputMsg = new RoleDialogModel ( AgentRole . User , message . Content ) ;
63
70
var conv = sp . GetRequiredService < IConversationService > ( ) ;
You can’t perform that action at this time.
0 commit comments