
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
netlify-plugin-redirect-with-auth
Advanced tools
Add redirects with authorization header set in env variable
This Netlify build plugin allows you to add redirects with authentication headers to your Netlify site.
netlify.toml
filenpm install netlify-plugin-redirect-with-auth
netlify.toml
file:[[plugins]]
package = "netlify-plugin-redirect-with-auth"
[plugins.inputs]
redirects = [
{ from = "/submit", to = "https://api.example.com/submit" },
{ from = "/api/*", to = "https://api.example.com/:splat" }
]
Set the NETLIFY_REDIRECT_AUTH_HEADER
environment variable:
For production:
NETLIFY_REDIRECT_AUTH_HEADER
Bearer your-token-here
)For development:
.env
file in your project root (if it doesn't exist already).env
file:
NETLIFY_REDIRECT_AUTH_HEADER=Bearer your-token-here
netlify dev
Note: Make sure to add .env
to your .gitignore
file to avoid committing sensitive information to your repository.
Set the following environment variable in your Netlify site settings:
NETLIFY_REDIRECT_AUTH_HEADER
: The authentication header to be added to the redirects.Configure the plugin in your netlify.toml
file:
[[plugins]]
package = "netlify-plugin-redirect-with-auth"
[plugins.inputs]
redirects = [
{ from = "/submit", to = "https://api.example.com/submit" },
{ from = "/api/*", to = "https://api.example.com/:splat" }
]
Each redirect object in the redirects
array must have both from
and to
properties.
onPreBuild
and onPreDev
events.NETLIFY_REDIRECT_AUTH_HEADER
environment variable.redirects
input to ensure it's a non-empty array of valid redirect objects.from
and to
URLsforce
flag set to trueIf you encounter issues:
NETLIFY_REDIRECT_AUTH_HEADER
environment variable is set correctly.redirects
input in netlify.toml
is formatted correctly.from
and to
properties.For more help, please open an issue in the plugin's GitHub repository.
FAQs
Add redirects with authorization header set in env variable
The npm package netlify-plugin-redirect-with-auth receives a total of 0 weekly downloads. As such, netlify-plugin-redirect-with-auth popularity was classified as not popular.
We found that netlify-plugin-redirect-with-auth demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.