Skip to content

Commit

Permalink
Merge pull request #1279 from Badgerati/Issue-1278
Browse files Browse the repository at this point in the history
Fix scoping issue when using variables to create route groups
  • Loading branch information
Badgerati authored Apr 3, 2024
2 parents 9807b41 + d404e20 commit 90d3602
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit 90d3602

Please sign in to comment.