File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ class LoopMcpServerStartCommand extends Command
19
19
protected $ signature = 'loop:mcp:start
20
20
{--user-id= : The user ID to authenticate the requests with}
21
21
{--user-model= : The model to use to authenticate the requests with}
22
+ {--auth-guard= : The Auth guard to use to authenticate the requests with}
22
23
{--debug : Enable debug mode} ' ;
23
24
24
25
protected $ description = 'Run the Laravel Loop MCP server ' ;
@@ -30,6 +31,7 @@ public function handle(McpHandler $mcpHandler): int
30
31
}
31
32
32
33
if ($ this ->option ('user-id ' )) {
34
+ $ authGuard = $ this ->option ('auth-guard ' ) ?? config ('auth.defaults.guard ' );
33
35
$ userModel = $ this ->option ('user-model ' ) ?? 'App \\Models \\User ' ;
34
36
$ user = $ userModel ::find ($ this ->option ('user-id ' ));
35
37
@@ -39,7 +41,7 @@ public function handle(McpHandler $mcpHandler): int
39
41
return Command::FAILURE ;
40
42
}
41
43
42
- Auth::login ($ user );
44
+ Auth::guard ( $ authGuard )-> login ($ user );
43
45
44
46
if ($ this ->option ('debug ' )) {
45
47
$ this ->debug (sprintf ('Authenticated with user ID %s ' , $ this ->option ('user-id ' )));
You can’t perform that action at this time.
0 commit comments