You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm experiencing an issue where the basicAuth configuration doesn't work as expected for multiple routes. While it works perfectly for a single route, it fails to operate correctly when more than one route is specified.
Steps to Reproduce
Set the basicAuth configuration to include multiple paths like [ '/e-voucher-uat', '/en/e-voucher-uat', '/ku/e-voucher-uat' ].
Try to access any of the paths.
Expected Behavior
I expect that accessing any of the paths specified in the configuration would require basic authentication.
Actual Behavior
Only the first path in the configuration array (/e-voucher-uat in this case) is requiring basic authentication. Other paths are not prompting for authentication.
Code Snippet (Optional)
Upon checking the basicAuth.mjs file, I noticed that the .some() method is used to check the paths. Here's the relevant code snippet:
Description
I'm experiencing an issue where the
basicAuth
configuration doesn't work as expected for multiple routes. While it works perfectly for a single route, it fails to operate correctly when more than one route is specified.Steps to Reproduce
basicAuth
configuration to include multiple paths like[ '/e-voucher-uat', '/en/e-voucher-uat', '/ku/e-voucher-uat' ]
.Expected Behavior
I expect that accessing any of the paths specified in the configuration would require basic authentication.
Actual Behavior
Only the first path in the configuration array (
/e-voucher-uat
in this case) is requiring basic authentication. Other paths are not prompting for authentication.Code Snippet (Optional)
Upon checking the
basicAuth.mjs
file, I noticed that the.some()
method is used to check the paths. Here's the relevant code snippet:The
.some()
method stops iterating as soon as it finds a match, causing only the first path to work as expected.Environment
Additional Information
None
Possible Solution
Consider using
.forEach()
or another looping mechanism that will check all paths before deciding to skip authentication.The text was updated successfully, but these errors were encountered: