-
Notifications
You must be signed in to change notification settings - Fork 56
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
Rate limiter driver options not being properly passed #433
Comments
Hey, I think that redis then can have a bit different interface for unstorage. How it works currently is that with rate limiter you select a driver (memory, lru, redis, etc) and you pass options as a second parameter. These options are then passed to the unstorage driver. So the thing is that we may need to add a condition there so that if the driver is redis, we need to spread the options instead of passing them as options https://github.com/Baroshem/nuxt-security/blob/main/src/module.ts#L270C15-L270C22 |
I'm not too sure, but shall we always spread options ? |
I think as well but maybe @pi0 would be able to help here? Pooya, what would be your recommended approach to passing options to underlying unstorage in such case? |
Version
nuxt-security: V1.3.2
nuxt: v3.11.2
Steps to reproduce
npx nuxi@latest module add security
npm run dev
127.0.0.1:6379
instead of the url provided in config.What is Expected?
Redis attempts to connect to url provided in config
What is actually happening?
Redis attempts to connect to the default url of
127.0.0.1:6379
because the storage options are not properly passed to unstorage's redis driver.By adding
console.log(opts)
tonode_modules/unstorage/drivers/redis.mjs
it shows that the redis driver is recivingwhen it is expecting a structure like
I do not think this is an issue with unstorage since nuxt-session uses unstorage in a similar way and does not have this issue.
The text was updated successfully, but these errors were encountered: