rrd108 / nuxt-api-shield

Nuxt API Rate Limiter / Brute Force Protection
5 stars 2 forks source link

Fixed useRuntimeConfig is not defined #10

Closed nd2024 closed 1 month ago

nd2024 commented 1 month ago

Got this error below when using this module. I fix it by importing useRuntimeConfig inside isBanExpired.

"useRuntimeConfig is not defined"
at isBanExpired (D:\2024-2025\Projects\mn-v3-microservices\Frontend\[PROJECT]\node_modules\nuxt-api-shield\dist\runtime\server\utils\isBanExpired.mjs:2:19)
at Object.handler (D:\2024-2025\Projects\mn-v3-microservices\Frontend\[PROJECT]\node_modules\nuxt-api-shield\dist\runtime\server\middleware\shield.mjs:24:7)
at async /D:/2024-2025/Projects/mn-v3-microservices/Frontend/[PROJECT]/node_modules/h3/dist/index.mjs:1962:19
at async Object.callAsync (/D:/2024-2025/Projects/mn-v3-microservices/Frontend/[PROJECT]/node_modules/unctx/dist/index.mjs:72:16)
at async Server.toNodeHandle (/D:/2024-2025/Projects/mn-v3-microservices/Frontend/[PROJECT]/node_modules/h3/dist/index.mjs:2249:7)

9

rrd108 commented 1 month ago

Thank you for the PR, but before I merge it I would need a reproduction link, or code or something to see why it happens to some users.

Can you provide something?