Skip to content
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

Fix scoping issue when using variables to create route groups #1279

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/web-route-group.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Start-PodeServer -Threads 2 {
# here you'd check a real user storage, this is just for example
if ($username -eq 'morty' -and $password -eq 'pickle') {
return @{
User = @{ ID ='M0R7Y302' }
User = @{ ID = 'M0R7Y302' }
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/Public/Routes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@ function Add-PodeRouteGroup {
}

# add routes
$null = Invoke-PodeScriptBlock -ScriptBlock $Routes -UsingVariables $usingVars -Splat
$null = Invoke-PodeScriptBlock -ScriptBlock $Routes -UsingVariables $usingVars -Splat -NoNewClosure
}

<#
Expand Down Expand Up @@ -1441,7 +1441,7 @@ function Add-PodeStaticRouteGroup {
}

# add routes
$null = Invoke-PodeScriptBlock -ScriptBlock $Routes -UsingVariables $usingVars -Splat
$null = Invoke-PodeScriptBlock -ScriptBlock $Routes -UsingVariables $usingVars -Splat -NoNewClosure
}


Expand Down Expand Up @@ -1521,7 +1521,7 @@ function Add-PodeSignalRouteGroup {
}

# add routes
$null = Invoke-PodeScriptBlock -ScriptBlock $Routes -UsingVariables $usingVars -Splat
$null = Invoke-PodeScriptBlock -ScriptBlock $Routes -UsingVariables $usingVars -Splat -NoNewClosure
}

<#
Expand Down
Loading